Forum Discussion

smpa01's avatar
smpa01
Community Champion
1 year ago
Solved

detect runtime

Is there any way for a code to return the environment in notebook;     //pseudocode print(os.environ) // detects either Fabric or Databricks runtime     thank you in advance
  • smpa01's avatar
    smpa01
    1 year ago

    The problem requires a code that runs across platforms

    sys.modules

     and returns unique values related to 'fabric' or 'databricks' or a key that contains  'fabric' or 'databricks' .

     

    I am still open for a better solution but for now I can survive with this.