Always start ipython with pylab equal to the built-in, but switch it at some time

Is there any agreement or configuration setting to start the IPython shell? For example, when I start IPython, I almost always start it with pylab --inline . One approach is to create an alias, for example alias ipython="ipython --pylab inline" . However, I think that it is impossible to start a shell with various parameters (except for the inline option), as soon as I decided to create and use an alias.

So, is it possible to always run the shell with the pylab=inline parameter, but still switch it when I do not need it (or, rather, when I want to avoid it)?

(Do not suggest creating an alias with different names, for example ipy or ipyWithPylab , please.)

Thanks.

+2
python alias configuration ipython
source share
1 answer

ipython qtconsole --help-all says:

 --IPKernelApp.matplotlib=<CaselessStrEnum> Default: None Choices: ['auto', 'gtk', 'inline', 'osx', 'qt', 'qt4', 'tk', 'wx'] --IPKernelApp.pylab=<CaselessStrEnum> Default: None Choices: ['auto', 'gtk', 'inline', 'osx', 'qt', 'qt4', 'tk', 'wx'] Pre-load matplotlib and numpy for interactive use, selecting a particular matplotlib backend and loop integration. 

therefore c.IPKernelApp.matplotlib='inline' in your *_config.py (possibly in ~/.ipython/profile_default ) will work. Please read how to configure IPyton , usually the doc explains a lot about how to do things.

Be careful, however, there is a difference between the presence of straight figures and the presence of the %pylab . Un-pylab kernel is impossible (for example, it is impossible that python does not import the module). With 1.0 and above and the last matplotlib, you can switch inline / not inline with %matplotlib <backend> magic.

+2
source share

All Articles