How can I programmatically get my notebook default language?

NLearn
New Contributor II

I'm writing some code to perform regression testing which require notebook path and its default language. Based on default language it will perform further analysis. So how can I programmatically get my notebook default language and save in some variable.

 

jose_gonzalez
Databricks Employee
Databricks Employee

You can get the default language of a notebook using dbutils.notebook.get_notebook_language() 

try this example:

%python
import dbutils
default_language = dbutils.notebook.get_notebook_language()
print(default_language)