[Pythonmac-SIG] MacPython 2.3 and Gnuplot

Jack Jansen Jack.Jansen at cwi.nl
Thu Jun 5 22:28:44 EDT 2003


There are two things with PythonIDE that could make a difference (at  
least, two things that I can quickly come up with:-) when it is run  
from the Finder:
- The working directory for PythonIDE is funny, I think it is "/".
- stdin/stdout/stderr are funny. stdin is closed (or maybe /dev/null?),  
stdout and stderr go to the console. Note that this only matter for  
programs started by the IDE: Python scripts get a fairly normal-looking  
sys.stdin/stdout/stderr pointing to the output window.

First thing I would try is running the IDE from a Terminal window with
% /Applications/MacPython-2.3/PythonIDE/Contents/MacOS/PythonIDE
and see what happens then. There's a good chance that gnuplot will work  
in this IDE, because it doesn't have the funny behaviour sketched  
above. If it doesn't work you may get interesting output from gnuplot  
in your terminal window. If it does not work you could run the IDE from  
the Finder again, and use the Applications->Utilities->Console  
application to see whether gnuplot gives any output on the console.

On donderdag, jun 5, 2003, at 18:34 Europe/Amsterdam, Michael Johnson  
wrote:

> I am close to getting Gnuplot and Gnuplot.py to work with MacPython  
> 2.3,
> but not quite there. It works with the command line  
> /usr/local/bin/python
> but not with PythonIDE. I hope someone here can straighten me out.
>
> I installed MacPython 2.3b1 and then used Package Manager to install
> Numeric-22.0-binary.
>
> Separately I installed gnuplot-3.7.1, which works fine (with aquaterm).
>
> I downloaded gnuplot-py-1.6. Since MacPython 2.3 installs a  
> command-line
> version in /usr/local,  I used this to install gnuplot.py by running  
> the command
> "/usr/local/bin/python setup.py install" within the gnuplot.py  
> directory.
>
> This installs gnuplot.py in what appears to be the right place:
> /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- 
> packages/Gnuplot
>
> The result  works beautifully using the command-line version of python.
> For instance, cd'ing  to the Gnuplot directory just above and issuing  
> the
> command "/usr/local/python demo.py" works as advertised.
>
> However, I can't get Gnuplot to work using the IDE. It successfully  
> imports
> Numeric and  Gnuplot. But when issuing gnuplot commands like those in
> the demo.py it fails with the error
>     "IOError: [Errno 32] Broken pipe."
> The traceback points to self.flush() in gp_macosx.py. I tried playing  
> with the
> gnuplot_command variable in  gp_macosx.py (to point directly to the  
> unix
> gnuplot command), to no avail.
>
> So my question is: can I get Gnuplot.py to work with MacPython's IDE?
>
> Thanks for any clues.
> Michael Johnson
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
--
- Jack Jansen        <Jack.Jansen at oratrix.com>         
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma  
Goldman -




More information about the Pythonmac-SIG mailing list