[IPython-User] IPython included in Spyder v1.1.0

Brian Granger ellisonbg@gmail....
Fri Jun 18 14:20:44 CDT 2010


This is great!  This summer we have two GSoC students working on some
things that will make this type of thing much easier.  We are moving
IPython itself to a two process model.  This means that we will be
facing many of the issue you are facing now.  Hopefully by the end of
the summer most of these things will be worked out.  More comments
inline below...

On Wed, Jun 16, 2010 at 2:10 PM, Pierre Raybaut
<pierre.raybaut@gmail.com> wrote:
> Hi all,
> Spyder (Scientific PYthon Development EnviRonment) is a free open-source
> Python development environment providing MATLAB-like features in a simple
> and light-weighted software, available for Windows XP/Vista/7, GNU/Linux and
> MacOS X:
>    * advanced code editing features (code analysis, ...)
>    * interactive console with MATLAB-like workpace (with GUI-based list,
> dictionary, tuple, text and array editors --
> screenshots: http://packages.python.org/spyder/console.html#the-workspace)
> and integrated matplotlib figures
>    * external console to open an interpreter or run a script in a separate
> process (with a global variable explorer providing the same features as the
> interactive console's workspace)
>    * code analysis with pyflakes and pylint
>    * search in files features
>    * documentation viewer: automatically retrieves docstrings or source code
> of the function/class called in the interactive/external console
>    * integrated file/directories explorer
>    * MATLAB-like path management
>    ...and more!
> Since v1.1.0 (which has recently reached Release Candidate 1), IPython has
> been integrated in the external console.
> See here: http://spyderlib.googlegroups.com/web/ipython.png
> and there: http://spyderlib.googlegroups.com/web/spyder_light.png
> That is great news (and I hope that you will be excited by these
> screenshots), and following this, Spyder v2.0 should be almost completely
> based on IPython.
> However, I still have some difficulties with IPython and I would really
> appreciate some help to fix these bugs.
> First of all, let me explain how it works. It's quite simple actually: I'm
> opening a Python interpreter in another process (QProcess) and this
> interpreter executes a startup script which is here:
> http://code.google.com/p/spyderlib/source/browse/spyderlib/widgets/externalshell/startup.py
> Now you can see that on Windows platforms, I'm forced to do ugly things to:
> 1. fix the encoding which is not properly detected by Python in the QProcess
> (I assume that it's a Python bug on Windows) and cause errors in pyreadline

Not sure about this one.

> 2. change the sys.platform to anything but 'win32' to prevent IPython from
> doing this: (in IPython.genutils):
> if sys.platform == 'win32' and readline.have_readline:
>     Term = IOTerm(cout=readline._outputfile,cerr=readline._outputfile)

When we separate IPython into two processes, this logic will be
modified, so this should be taken care of.

> 3. add an environment variable (to the QProcess): TERM=emacs, to prevent
> IPython from using msvcrt for the 'page_more' function implementation
> because like emacs, Spyder doesn't like to be bypassed with msvcrt.getch()
> (see IPython.genutils.page_more definitions)

The paging functionality will need to be refactored as well.

For now, I think the hacks you are doing are probably the best way to
go - at least until we get the two process stuff working in ipython
itself this summer.

> Worse, I found a very strange bug happening when opening a PyQt file dialog
> (QFileDialog.xxx) from a mainwindow -- e.g. when using the "save figure"
> feature in a matplotlib figure: the GUI window freezes and switching back to
> the IPython console and pressing Enter will unblock it! This bug only
> happens in a IPython session launched into a Python interpreter running in a
> separate process (it does not happen in a simple Python interpreter running
> in a separate process).

This probably has something to do with threading and event loops.  You
will definitely run into problems with the current designof ipython.
Again, this is one of our top priorities that we are working on this

> Any help would be really appreciated!

I would join the ipython-dev list to follow along as we progress this summer.



> Thanks,
> Pierre
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo

More information about the IPython-User mailing list