[Edu-sig] IDLE and Matplotlib

John Zelle john.zelle at wartburg.edu
Wed Jan 12 02:17:01 CET 2005


Hans,

I know you are already in communication/waiting for a bugfix on this, 
but I have a quick inquiry. This sounds related to issues I've had with 
my graphics library (now solved, knock on wood). I would think that 
running IDLE -n would solve this problem for you. Please see my question 
below:

Hans Fangohr wrote:

> Dear all,
>
> I am about to teach Python to a number of students who already know 
> how to use Matlab (on a basic level). For that reason, the matplotlib 
> library for plotting curves is ideally suited (it seems quite good 
> anyway).
>
> The teaching computers are Win XP machines. I have settled for the 
> Enthough Python Edition and the latest matplotlib (both executables 
> can be found in www.soton.ac.uk/~fangohr/download/python).
>
> I have prepared the exercises on linux and am now trying to run them 
> in windows. This is where I realised that matplotlib doesn't work well 
> with IDLE.
>
> More particularly, it is known that the default backend TkAgg doesn't 
> work with IDLE (see here 
> http://matplotlib.sourceforge.net/backends.html#TkAgg)
> but it appears to work with "IDLE -n" (this is what it says on that 
> web page).
>
> The problem I experience is this:
>
> -start idle
> -execute these commands:
>
>   import pylab
>   pylab.plot(range(10))
>   pylab.show()
>
> This produces a figure window which seems to work fine.
>
> At this point when closing the figure window, I can't get the IDLE 
> prompt active again. (It seems that IDLE thinks the program and the 
> figure process are still running, and is waiting for control to return.)
>
> This, in itself, is maybe not suprising. However, the idle -n switch 
> doesn't seem to solve the problem for me (see below).
>
> The same problem is observed when I execute a program in the IDLE 
> editor (by pressing F5).
>
> What do people think how I should continue?
>
> I could
>
>  - try to make IDLE work with matplotlib (I think this is my preferred 
> option)
>    In that case, how do I tell IDLE on Windows to start with -n? (Not a
>    Windows freak). In the start menu, I can change the properties for the
>    link to idle from  '''
>
>     C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw"
>
>     C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw" "-n"
>
>    but this doesn't seem to solve the problem: I get exactly the same
>    behaviour as described above.

When you say you get exactly the same result, does this mean that IDLE's 
behavior is unchanged? If so, you are not getting the -n flag set. IDLE 
should fire up with a message that simply says "no subprocess" instead 
of the warning about personal firewalls. If you just mean that 
Matplotlib acts the same, that's a different story. What happens if you 
change the menu item to this:

C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw -n"

Unfortunately, I don't have access to Windows to try this out at the 
moment. Another way to fire up IDLE in the -n mode is to right-click on 
a Python file and then select "edit with IDLE." I actually find it 
annoying that opening IDLE this way puts it in -n mode, but it might be 
a way to test out exactly what's happening.



>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>
>


More information about the Edu-sig mailing list