[IPython-User] ipython package import mechanism exhibits different behaviour

Thomas Kluyver takowl@gmail....
Mon Jul 30 12:25:15 CDT 2012


On 30 July 2012 18:05, Antony Lee <antony.lee@berkeley.edu> wrote:
> Out of curiosity, when is the path "set up to include the working
> directory"? I thought that was Python's default behaviour, but apparently
> not?

I believe Python's default behaviour is to include the directory in
which a script is run. Since IPython itself is launched by a Python
script, I guess it would include the directory where that is - e.g.
/usr/bin/

Grepping the codebase, it looks like we add the cwd to the path in
IPython.core.shellapp.InteractiveShellApp.init_path()

Best wishes,
Thomas


More information about the IPython-User mailing list