[IPython-User] new profile based on pylab

elmar werling elmar@net4werling...
Tue Oct 9 15:07:11 CDT 2012


Am 06.10.2012 20:27, schrieb Thomas Kluyver:
> On 6 October 2012 08:37, Fernando Perez <fperez.net@gmail.com> wrote:
>> You'll need to add whatever code you want to that profile manually,
>> such as hardcoding that pylab is activated, a preferred GUI, etc.
>
> For reference, I think to hardcode activating pylab for a particular
> profile, you need to add something like this to exec_lines:
>
> get_ipython().enable_pylab(gui='inline', import_all=True, welcome_message=True)
>
> (All the parameters to that are optional, but I've shown them in case
> you want to customise them)
>
> Thomas
>
Thanks for help.

Finally there is a real simple solution (see below)

Elmar

#############################################

lines = """
%pylab
import pandas as pd
import ....
"""

app = c.InteractiveShellApp

if hasattr(app, 'exec_lines'):
     app.exec_lines.append(lines)
else:
     app.exec_lines = [lines]



More information about the IPython-User mailing list