PyGnuplot icon indicating copy to clipboard operation
PyGnuplot copied to clipboard

PyGnuplot feature request: capture & return of stdout/stderr info

Open jrbrearley opened this issue 8 years ago • 1 comments

As part of debugging prior issues, I learned a trick to get gnuplot to basically send some info back to me at the end of a command set. This was done to diagnose the commands being tested. At the end of the command set, I would add the following:

cmd_cleanup = "show output; unset output"

The show output would give me the filename of where the png/jpeg file was going to be stored. The unset would tell gnuplot to flush the output and release file system locks on it. If I got a different message, that gave me a clue that the most recent command I had sent was malformed and needded work.

Anyway, PyGnuplot does not currently turn on stdout or stderr as part of the instantiation command.

You would need something like: proc = _Popen(['gnuplot', '-p'], shell=False, stdin=_PIPE, stdout=_PIPE, stderr=_PIPE) # persitant -p

and later on in .c method do: out,err = proc.communicate() ;# gives a tuple

Maybe .c method could return out,err? Also print them to the console?

jrbrearley avatar Oct 31 '17 16:10 jrbrearley

#12

ddipp avatar May 11 '19 14:05 ddipp