Brian,<br><br><div class="gmail_quote">2010/6/18 Brian Granger <span dir="ltr"><<a href="mailto:ellisonbg@gmail.com">ellisonbg@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5">
> Since v1.1.0 (which has recently reached Release Candidate 1), IPython has<br>
> been integrated in the external console.<br>
> See here: <a href="http://spyderlib.googlegroups.com/web/ipython.png" target="_blank">http://spyderlib.googlegroups.com/web/ipython.png</a><br>
> and there: <a href="http://spyderlib.googlegroups.com/web/spyder_light.png" target="_blank">http://spyderlib.googlegroups.com/web/spyder_light.png</a><br>
> That is great news (and I hope that you will be excited by these<br>
> screenshots), and following this, Spyder v2.0 should be almost completely<br>
> based on IPython.<br>
> However, I still have some difficulties with IPython and I would really<br>
> appreciate some help to fix these bugs.<br>
> First of all, let me explain how it works. It's quite simple actually: I'm<br>
> opening a Python interpreter in another process (QProcess) and this<br>
> interpreter executes a startup script which is here:<br>
> <a href="http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/externalshell/startup.py" target="_blank">http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/externalshell/startup.py</a><br>
> Now you can see that on Windows platforms, I'm forced to do ugly things to:<br>
> 1. fix the encoding which is not properly detected by Python in the QProcess<br>
> (I assume that it's a Python bug on Windows) and cause errors in pyreadline<br>
</div></div>><br>Not sure about this one.<br></blockquote><div><br>Maybe I wasn't clear: this is not an IPython issue at all. This is only Python itself which is unable to detect stdout encoding when you are running it in a separate process on Windows (e.g. the same issue occurs in emacs running a Python shell on win32).<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
> 2. change the sys.platform to anything but 'win32' to prevent IPython from<br>
> doing this: (in IPython.genutils):<br>
> if sys.platform == 'win32' and readline.have_readline:<br>
> Term = IOTerm(cout=readline._outputfile,cerr=readline._outputfile)<br>
<br>
</div>When we separate IPython into two processes, this logic will be<br>
modified, so this should be taken care of.<br>
<div class="im"><br>
> 3. add an environment variable (to the QProcess): TERM=emacs, to prevent<br>
> IPython from using msvcrt for the 'page_more' function implementation<br>
> because like emacs, Spyder doesn't like to be bypassed with msvcrt.getch()<br>
> (see IPython.genutils.page_more definitions)<br>
<br>
</div>The paging functionality will need to be refactored as well.<br>
<br>
For now, I think the hacks you are doing are probably the best way to<br>
go - at least until we get the two process stuff working in ipython<br>
itself this summer.<br>
<div class="im"><br>
> Worse, I found a very strange bug happening when opening a PyQt file dialog<br>
> (QFileDialog.xxx) from a mainwindow -- e.g. when using the "save figure"<br>
> feature in a matplotlib figure: the GUI window freezes and switching back to<br>
> the IPython console and pressing Enter will unblock it! This bug only<br>
> happens in a IPython session launched into a Python interpreter running in a<br>
> separate process (it does not happen in a simple Python interpreter running<br>
> in a separate process).<br>
<br>
</div>This probably has something to do with threading and event loops. You<br>
will definitely run into problems with the current designof ipython.<br>
Again, this is one of our top priorities that we are working on this<br>
summer.<br></blockquote><div><br>I really hoped that someone could think of a workaround for this one... I'm quite stuck with it! :)<br>And I hope I won't have to wait until next IPython is released to fix this bug: v0.10 has still not spread everywhere judging from users feedbacks.<br>
<br>Cheers,<br>Pierre<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> Any help would be really appreciated!<br>
<br>
</div>I would join the ipython-dev list to follow along as we progress this summer.<br>
<br>
Cheers,<br>
<br>
Brian<br>
<br>
> Thanks,<br>
> Pierre<br>
> _______________________________________________<br>
> IPython-User mailing list<br>
> <a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Brian E. Granger, Ph.D.<br>
Assistant Professor of Physics<br>
Cal Poly State University, San Luis Obispo<br>
<a href="mailto:bgranger@calpoly.edu">bgranger@calpoly.edu</a><br>
<a href="mailto:ellisonbg@gmail.com">ellisonbg@gmail.com</a><br>
</font></blockquote></div><br>