Gnuplot on Windows

Paul Simmonds psimmo60 at hotmail.com
Thu Nov 21 10:11:32 EST 2002


Hi folks,

I've got a graphical application that uses Michael Haggerty's
Gnuplot-py extension. On Unix, this works great (thanks Michael) by basing 
IO on a popen command.

The Windows version of gnuplot is a GUI app, so a stdin stream is created by 
wrapping it in a console app using the PostMessage Windows API command (done 
through the public domain pgnuplot program).

I'm having trouble writing to this stream, though. This illustrates the 
problem:

Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>import Gnuplot
>>>a=Gnuplot.Gnuplot()
>>>a.plot('1.dta') # A simple data file
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "F:\SIMMONDS\python22\Lib\site-packages\Gnuplot\_Gnuplot.py", line 
281, in plot
    self.refresh()
  File "F:\SIMMONDS\python22\Lib\site-packages\Gnuplot\_Gnuplot.py", line 
222, in refresh
    self(self.plotcmd + ' ' + string.join(plotcmds, ', '))
  File "F:\SIMMONDS\python22\Lib\site-packages\Gnuplot\_Gnuplot.py", line 
206, in __call__
    self.gnuplot(s)
  File "F:\SIMMONDS\python22\Lib\site-packages\Gnuplot\gp_win32.py", line 
122, in __call__
    self.write(s + '\n')
IOError: [Errno 22] Invalid argument
>>># Working through the hierarchy gives me
>>>a.gnuplot.gnuplot
<open file 'f:\simmonds\gnuplot\pgnuplot.exe', mode 'w' at 0x00792CE8>
>>>a.gnuplot.gnuplot.write("hello")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
IOError: [Errno 22] Invalid argument

I had a check through the Gnuplot-py project page, and there was another 
support request describing the same thing, but no answer was given.

I'd be grateful for any comments.
Thanks in advance,
Paul

**********************************************
I used to have a handle on life, but it broke.
**********************************************

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail





More information about the Python-list mailing list