##// END OF EJS Templates
Add setting to disable venv warning (#13706)...
Add setting to disable venv warning (#13706) * Add setting to disable venv warning * Fix style * Add what's new entry * Improve help text * Use double quotes Co-authored-by: Blazej Michalik <6691643+MrMino@users.noreply.github.com> * Add missing comma Co-authored-by: Blazej Michalik <6691643+MrMino@users.noreply.github.com>

File last commit:

r23829:51ae2f68
r27697:66aeb3fc master
Show More
start_ipython_config.py
22 lines | 739 B | text/x-python | PythonLexer
/ examples / Embedding / start_ipython_config.py
Erich Spaker
fixed inaccurate references to "embedding"
r23829 """Quick snippet explaining how to set config options when using start_ipython."""
Erich Spaker
added example of configuring and embedded interpreter
r23827
# First create a config object from the traitlets library
from traitlets.config import Config
c = Config()
# Now we can set options as we would in a config file:
# c.Class.config_value = value
Erich Spaker
Added embedded configuration to docs
r23828 # For example, we can set the exec_lines option of the InteractiveShellApp
Erich Spaker
added example of configuring and embedded interpreter
r23827 # class to run some code when the IPython REPL starts
c.InteractiveShellApp.exec_lines = [
'print("\\nimporting some things\\n")',
'import math',
"math"
]
c.InteractiveShell.colors = 'LightBG'
c.InteractiveShell.confirm_exit = False
c.TerminalIPythonApp.display_banner = False
Erich Spaker
Added embedded configuration to docs
r23828 # Now we start ipython with our configuration
Erich Spaker
added example of configuring and embedded interpreter
r23827 import IPython
IPython.start_ipython(config=c)