run subprocess in separate window

R

Radek

Hi,

I am trying to create GUI launcher of several applications using Python
and Tkinter.

Currently when using subprocess.Popen("mycommand") all output goes to
the stdout of my launcher.

For some command line applications I need to launch them so that their
output goes into the separate "terminal" window.

How can I make it?

Thanks,

Radek
 
A

aurelien.campeas

Radek a écrit :
Hi,

I am trying to create GUI launcher of several applications using Python
and Tkinter.

Currently when using subprocess.Popen("mycommand") all output goes to
the stdout of my launcher.

For some command line applications I need to launch them so that their
output goes into the separate "terminal" window.

How can I make it?

Thanks,

Radek

Hello, have a look at the subprocess module, it might help you get to
what you want.
 
R

Radek

Hello,

as you can see, I tried subprocess methods. But could not find the
right call.

Radek
 
H

heracek

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top