hi all,
I read the source file of pgnuplot.exe and write
a simple python program to simulate pgnuplot.exe.
I add a new py file named 'wgnuplot_tool.py' to
the python20\gnuplot. And I also modify the source
file gp_win32.py.
I'm using Python2.0, Gnuplot.py 1.5, Numeric 17.0.
Limition:
if many wgnuplot process exist in the system, I
can not distinguish the different process. So just
select the first window we find to send command to.
I don't know what will happen.
Modifiction:
in gp_win32.py:
1. add import:
from wgnuplot_tool import wgnuplot_proc
2. replace
self.gnuplot = popen
(GnuplotOpts.gnuplot_command, 'w')
to
self.gnuplot=wgnuplot_proc
(GnuplotOpts.gnuplot_command)
3. optionally you can replace
gnuplot_command = 'pgnuplot.exe'
to
gnuplot_command = 'wgnuplot.exe'
if you have not 'pgnuplot.exe', then you must
replace it.
Note:
Before modification make sure to backup it.
wgnuplot_tool.py
Logged In: YES
user_id=38106
Thanks for the proposed changes.
Do these modifications work with all versions of Windows?
If not, can you find a way for Gnuplot.py to open the pipe
to gnuplot in the appropriate way (i.e., your way when it is
needed or the old way when it is needed) depending on the
environment in which Gnuplot.py is being invoked? I am
reluctant to make changes to the Gnuplot.py distribution if
they will break functionality for users of different
versions of Windows or different versions of gnuplot.
Other questions: where do win32gui and win32con come from?
Are they a standard part of Python 2.0? Do they exist for
Python 1.5.2? In other words, are they modules that people
will already have available?
In what case is 'wgnuplot.exe' better than 'pgnuplot.exe'?
What should the documentation say about this?
Thanks,
Michael
Logged In: YES
user_id=195262
some answers:
1. I only test it in win2000, because the program
pgnuplot.exe can not work. I don't know other version of
windows, maybe in other version , pgnuplot.exe can work
well.
2. I think the problem IOErro in win2000 maybe result from
the program 'pgnuplot.exe', so if the pgnuplot.exe can work
well then the old may (open a pipe to pgnuplot) is better
for it is more operation-system independent.
3. for different version of gnuplot, I don't know whether
their windows version has similiar processing fashion and
same [windows class name] and [windows name]. But
if 'pgnuplot.exe' can work with different wgnuplot.exe I
think my simulation can also work with them.
4. win32gui and win32con come from winall, a package
especially for windows, you can browse this url:
http://www.python.org/windows/. Since the standard edition
of python does not include it so it must be installed by
user. Because the python I used is activePython from
http://www.activestate.com/ASPN/Downloads/ActivePython/, in
this version the winall package has be included default.
5. for some people who can not find 'pgnuplot.exe',
directly using 'wpgnuplot.exe' is the only way to use you
gnuplot.py in windows.
I think if you want to make changes to the Gnuplot.py
distribution you must test it in the different version of
windows, gnuplot, python. And consulting with the authors
of pgnuplot.exe maybe a good idea, from them we can know
what happened in IOError.
I attach the source file of pgnuplot.exe, maybe it is
useful for you.
Thanks
LiHui
the source of pgnuplot.exe
Logged In: YES
user_id=38106
Since I don't use Windows, I don't know how to decide about
your proposal. I suggest that you open a discussion on the
mailing list. If you can get a consensus about changes that
should be made, I'll incorporate them.