[IPython-User] Adding directory to sys.path at startup in qtconsole.

Prasanth oneaufs@gmail....
Wed Aug 10 10:34:46 CDT 2011


Hello,

In ipython (v.11) terminal app I can add a custom path to "sys.path" using
the following lines in ipython_config.py:

app = c.TerminalIPythonApp
lines = """
import sys
sys.path.append("/home/phn/projects/pythonlib")
"""
if hasattr(app, 'exec_lines'):
    app.exec_lines.append(lines)
else:
    app.exec_lines = [lines]

In ipython qtconsole I tried adding the following, in both Python 2.6 and
2.7, to ipython_qtconsole_config.py but couldn't get it to work.

lines = """
import sys
sys.path.append("/home/phn/projects/pythonlib")
"""
if hasattr(app, 'exec_lines'):
    app.exec_lines.append(lines)
else:
    app.exec_lines = [lines]

There are no error messages.

Am I using the wrong app? How do I get this to work?

Thanks very much,
Prasanth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110810/04df47ee/attachment.html 


More information about the IPython-User mailing list