[IPython-user] Exception embedding IPython - help please

brucedickey at micron.com brucedickey at micron.com
Fri Oct 14 15:48:31 CDT 2005


Python 2.3.4
IPython 0.6.15 for Python 2.3 from the src rpm
Embedding in a wxPython app, wxPython

First time user.

My code:

import IPython
from IPython.Shell import IPShellEmbed
args = ['-pdb', '-pprint', '-debug', '-colors', 'Linux']

ipshell = IPShellEmbed(args, banner = 'Entering IPython', exit_msg =
'Going back to main program')
ipshell("Here we go")
print 'Back in main program'

An exception is generated in shell.py ln 705 in fixLineEndings(): lines
= text.split('\r\n'),

from write(): text = self.fixLineEndings(text),

from raw_input(): write(prompt).

Well, prompt is a prompt object, not a string, so split() naturally does
not work on it.

Please tell me how to get around this.

Secondly, I would like to have the IPython shell available all the time
in a wxPython window w/o it being an either/or situation (run my
wxPython app or IPython but not both at once). I.e. Have a notebook
control with tabs for my app's functionality and a tab for IPython so
the user can select any tab and use what is on it at any time. Any way
to do this? The IPython doc made it look like the app its embedded in is
suspended while in ipshell()....



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/ipython-user/attachments/20051014/4fd15b7d/attachment.html 

More information about the IPython-user mailing list