[IPython-user] beginner's question

Fernando Perez Fernando.Perez at colorado.edu
Thu Mar 23 09:50:05 CST 2006


Charles Hartman wrote:
> I just started with IPython. (OS 10.4.5 on both PPC and Intel;  
> MacPython 2.4.1; wxPython 2.6.) I'm having a little trouble with the  
> wxPython connection. Here's (I'm sure) a very simple question from a  
> non-Unix-savvy newbie:
> 
> It was not true at first, but is true now, that on my PPC PowerBook  
> if I start with 'ipython' all is well, but if I start with 'ipython - 
> wthread' I get the message
> 		This program needs access to the screen. Please run with 'pythonw',  
> not 'python',
> 		and only when you are logged in on the main display of your Mac.
> After that if I give any keypress except ann immediately ctrl-D, then  
> I can only quit by closing the Terminal. This doesn't happen on the  
> Intel machine, but since it didn't originally happen on the PPC one I  
> doubt that's the issue. I know that "python" and "pythonw" both point  
> to scripts in /usr/local/bin (as does "ipython"), but I don't know  
> enough to see the next step. If it matters, 'env' shows nearly  
> identical results on the two machines.
> 
> Thanks for any guidance.

Mmh, I see there has been no reply to your question yet, so I'll take a stab 
(though I'm not 100% sure I'm right, since I don't use OSX myself).  You will 
probably be OK if you open /usr/local/bin/ipython and change its top line (the 
one starting with #!, known as the 'shebang line' in unix-ese) to read

#!/usr/bin/env pythonw

or

#!/usr/local/bin/pythonw

The first one is a preferred way, since it will find pythonw anywhere on your 
PATH, but use the second if the first fails.

I don't know if there are any problems with using pythonw all the time instead 
of python.  If there are, you can either make a copy of the ipython start 
script and name it ipythonw, or make an alias of the kind

alias ipythonw 'pythonw /usr/local/bin/ipython'

which will force ipython to be run under pythonw instead of plain python.

I hope this helps,

f




More information about the IPython-user mailing list