Quantcast

[IPython-User] start_ipython config backward

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[IPython-User] start_ipython config backward

freesoftware.ipython
Hello,

A while back (I can't remember which version of IPython I was using) I used the following code to launch IPython:


import IPython
config = IPython.config.loader.Config()

config.InteractiveShellApp.exec_lines = [
        'import numpy as np',
        'np.set_printoptions(linewidth=79)'
]

config.TerminalInteractiveShell.banner2 = 'Welcome!\n'

config.IPCompleter.limit_to__all__ = True

IPython.start_ipython(config=config)


but after updating to IPython 5.1.0 with Anaconda it doesn't work anymore:


config = IPython.config.loader.Config()
AttributeError: 'module' object has no attribute 'config'


How can I adapt my old code to the new API?

Thanks,

Hugo
_______________________________________________
IPython-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: start_ipython config backward

Thomas Kluyver-2
On 1 February 2017 at 10:03, <[hidden email]> wrote:
config = IPython.config.loader.Config()

The Config class is now part of traitlets; you can load it like this:

from traitlets.config import Config

_______________________________________________
IPython-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/ipython-user
Loading...