How do I execute a command from within python and wait on thatcommand?

B

black_13

how do i exec a command (such as xcopy) from with win32 python and
wait on that command
to come to completion? and also cleanly terminate the command shell?
thanks
black_13
 
M

Matt Nordhoff

Rafael said:
os.system(command)

or

proc = popen2.Popen3(command)
proc.wait()

I don't know about "cleanly terminat[ing] the command shell", but you
should use the subprocess module now, not any of the other functions
scattered around.
--
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top