##// END OF EJS Templates
Restore lineno's for Input mapped files (#13560)...
Restore lineno's for Input mapped files (#13560) * Implement lineno's for Input mapped files * Adopt In [123], line 123 format * Revert "Set co_name for cells run line by line. Fixes https://github.com/ipython/ipykernel/issues/841" (This reverts commit d11e987f174a15f1640f8006c86f58d884c3faa4.) * Omit mention of ", in <module>" for input tracebacks * Input cell -> Cell * Remove <module> from traceback doctests * Use f-string for `in ...' format * Simplify _format_list logic, converting to f-strings

File last commit:

r23829:51ae2f68
r27686:a72418e2
Show More
start_ipython_config.py
22 lines | 739 B | text/x-python | PythonLexer
"""Quick snippet explaining how to set config options when using start_ipython."""
# 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
# For example, we can set the exec_lines option of the InteractiveShellApp
# 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
# Now we start ipython with our configuration
import IPython
IPython.start_ipython(config=c)