Skip to content

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

Description

@jrbrearley

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions