Question

I've seen how to change the configuration of ipython either temporarily or permanently using commandline args or modifying ipython_qtconsole_config.py.

My question is, how can I get the current configuration like the ipython_qtconsole_config.py does:

c = get_config()
c.IPythonWidget.font_family = 'Consolas'

I can import IPython, but don't know what to do then...

Was it helpful?

Solution

You can access it through get_ipython().config:

get_ipython().config['IPythonWidget']['font_family']

Example:

In [1]: ip = get_ipython()

In [2]: ip.config
Out[2]: 
{'IPKernelApp': {'connection_file': u'C:\\Users\\falsetru\\.ipython\\profile_default\\security\\kernel-7008.json',
  'interrupt': 960,
  'parent_appname': 'ipython-qtconsole',
  'parent_handle': 956},
 'IPythonWidget': {'font_family': u'Consolas'},
 'ProfileDir': {},
 'Session': {'key': u'4c0284b9-3a26-4989-b995-c930ab67bef5'}}

In [3]: ip.config['IPythonWidget']['font_family']
Out[3]: u'Consolas'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top