Connecting to gnuplot with Popen?

Anton81 forum at anton.e4ward.com
Thu Mar 30 05:59:01 EST 2006


Hi,

it seems to be a FAQ, but I still haven't found a solution. I want to
control gnuplot with a python program. The following at least gives me the
gnuplot output:

subp=Popen("gnuplot",stdin=None,stderr=PIPE,stdout=PIPE)
...
subp.stderr.readline()

even though I'm not sure how to check if no more lines can be read with
readline() so that it doesn't block.
But after the script has finished, the console doesn't show me the
characters I type.

However, as soon as I try:

subp=Popen("gnuplot",stdin=PIPE,stderr=PIPE,stdout=PIPE)
...
subp.stderr.readline()

the program hangs.

What's wrong?

Anton



More information about the Python-list mailing list