Nov-30-2020, 05:17 PM
because you are using a subprocess, the output will be going to stdout (errors to stderr)
you can redirect stdout and stderr so that it will go to a file (or buffer in memory)
example to file:
You can redirect stderr in a similar fashion.
you can redirect stdout and stderr so that it will go to a file (or buffer in memory)
example to file:
savefile = full_filepath hold_stdout = sys.stdout sys.stdout = open(savefile, 'w') # all stdout will be written to file # when done, reset stdout so that you will see srcipt output: sys.stdout = hold_stdoutThis should work, but I haven't tested (but used something very similar in the past)
You can redirect stderr in a similar fashion.