problem to update gnuplot display using a Scale widget
Philippe Garteiser, PhD <Philippe-Garteiser <at> omrf.org>
2008-09-16 22:19:40 GMT
I am using a Tkinter GUI to operate a C binary whose input is a float number gotten from a Scale widget, and whose output is a datafile. I would like to get gnuplot to replot the datafile each time it is overwritten (in essence have the plot refreshed by the Scale slider).
To do that, I pass the function "printer(self,newval)", to the Scale's command. In the printer function, I use os.system to execute the binary, and I operate gnuplot as a special file opened by os.popen, to which I write with the chevrons print statement.
def __init__(self, parent):
print >>self.f,"plot \"data.dat\" with lines"
Unfortunately I don't obtain the expected result. The Tk window is there with functioning slider, the generate_data_file is executed and given the proper input value from the slider, but gnuplot is still a problem. The gnuplot window only comes up when I close the Tkinter window, and shuts down rapidly.
Do you have any ideas as to what I need to fix ? Also, it would be great not to have to use the pyGnuplot.py package, as the program will have to run on minimally installed boxes (i.e. standard python, no extra modules allowed).
Thanks a lot !
"It does not pay to leave a live
dragon out of your calculations"
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org