Hi All,
I am trying to call gnuplot from a python session. I have set up a two-way pipe,
and I can both send and receive data from gnuplot. The problem is that this
works only when I know exactly how much data is transmitted by gnuplot, or if
there is some signature that shows that transmission is completed. So, I can
send something like this (in pseudo code)
plot "foo.dat" with lines
print "TRANSMISSION_OVER"
which would send back the string "TRANSMISSION_OVER", whenever the command
executed properly. However, this works only, if there are no errors. If there is
an error, gnuplot sends back the error message, but not the sought-after string.
Obviously, the user would not know how many lines are on the pipe, so it is not
clear how long one is supposed to wait for gnuplot.
My question is whether anyone knows a way of handling this properly. Perhaps, if
gnuplot could return the prompt, even when piped, that could be a solution, but
as far as I see, once gnuplot figures that it is piped, it stripes the prompt of
any print-out.
Thanks,
Zoltán
|