Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ipython Configuration - Config Classes Overview

Tags:

ipython

I have read, checked the <0.11 docs, and then re-read the IPython manual. Granted I may not have memorized each page, but there is a significant lack of organization and clarity for beginners. Please someone who knows Ipy-Fu, teach me the ways... all I ever wanted was a shell that worked on windows.

I am trying to figure this out on 0.12 and 0.13, neither proven successful. The manpages provide lots of examples, but none of the examples really match the default configuration files that Ipython installs (especially regarding profiles). I am on Windows7-64, although I don't think that matters. Most of my problems are relate to QtConsole, but Im not even sure I know how I got the terminal working right, and I am scared to even touch my config now. I have one single profile ('default'), and I cannot get my configs to harmonize.

Please explain the inheritance of the config classes, it is not really obvious, and there is little explaination without digging into development chapters.

What are these, why do I want them, and what do they do:

-InteractiveShellApp
-TerminalIPythonApp
-ZMQTerminalIPythonApp
-TerminalInteractiveShell
-IPKernelApp
-ZMQTerminalInteractiveShell
-ZMQInteractiveShell
-Session (zmq sessions i think)
-IPythonQtConsoleApp
-IPythonWidget

I can't change the banner on my QtConsole IPy. I feel retarded after 20 hours of configuration madness.r

like image 722
user2097818 Avatar asked Sep 26 '26 23:09

user2097818


1 Answers

Sorry about the messy docs, we plan on writing more user friendly when possible, but there is a lot to do.

if you do ipython profile create profile_name ipython will create a new configuration named profile_name with which you can mess as much as you want without beeing scared, just use ì ipython [subcommand] [options] --profile=profile_name to use it.

The configuration is directly tied to the implementation, so "explaining" each of those would be difficult and long. In short, if you define the following in IPython:

class FooBar(Configurable):

    myvar = Unicode('empty', config=True)

    .... rest of implementation

In your config file you can do

c.FooBar.myvar = 'Hello World'

and it wil do what you expect, each instance of FooBar will have myvar set to 'Hello World'. Hence the tight relation between Implementation and configuration that got the same inheritance diagram.

I suggest you have a look at ipython --help-all ipython qtconsole --help-all ... etc Help is dynamically generated so will alway be up to date with the version you are using.

As for the qtconsole banner, I'm not even sure this one is configurable.

If you have a more precise question of what you want to do and what goes wrong you can comme to the ML.

Also sorry for lack of help on windows specific stuff we have too few users (and no dev) using windows, so it is hard to help.

NB, you can also play with config at run time with the %config magic.

like image 175
Matt Avatar answered Sep 29 '26 23:09

Matt