run subprocess in separate window
heracek
tomas.horacek at gmail.com
Fri Oct 27 04:27:13 EDT 2006
On Oct 15, 6:43 pm, "Radek" <radek.sv... at gmail.com> wrote:
> Currently when using subprocess.Popen("mycommand") all output goes to
> the stdout of my launcher.
>
Hi,
the solution is:
p = subprocess.Popen(args=['command', 'arg1', 'arg2'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
print p.stdout.read() # stderr and strout mix
or:
p = subprocess.Popen(args=['command', 'arg1', 'arg2'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
print p.stderr.read()
print p.stdout.read()
h.
More information about the Python-list
mailing list