1

I have Jupyter QtConsole installed in Ubuntu 16.04. How can I set default configuration like font family, size and initial imports?

Amani
  • 16,245
  • 29
  • 103
  • 153

1 Answers1

4

The docs on configuration options for jupyter will be very helpful here.

In short, open ~/.jupyter/jupyter_qtconsole_config.py in your favorite text editor and find your options of interest.

  • Font family : c.ConsoleWidget.font_family
  • Font size : c.ConsoleWidget.font_size

Startup scripts and initial imports will be a little more complicated since those are properties of the ipython kernel, which will need to be set in your ipython config. In ~/.ipython/profile_default/ipython_kernel_config.py,

  • Initial imports : c.InteractiveShellApp.exec_lines = ['import numpy as np','import pandas as pd']
Thtu
  • 1,992
  • 15
  • 21
  • 1
    In ~/.jupyter there no file named 'jupyter_qtconsole_config.py'. I also presume 'c' (as in c.ConsoleWidget.font_family' is a class. How do I get c? – Amani May 04 '16 at 20:34
  • If it doesn't exist, just run `touch ~/.jupyter/jupyter_qtconsole_config.py`. "c" and other config classes will be loaded as globals when you first start up qtconsole, so you shouldn't need to worry about it. – Thtu May 04 '16 at 20:36
  • 10
    To generate default configuration, you can also run `jupyter qtconsole --generate-config` in terminal. `~/.jupyter/jupyter_qtconsole_config.py`will be generated with a lot default settings. – Richard Oct 03 '18 at 13:54
  • 1
    @Richard - The comment is much worth posting as an answer. – sancho.s ReinstateMonicaCellio Jul 04 '20 at 09:45