[Tutor] Executing dos .bat file with Python script (original) (raw)

Bernard Lebel python at bernardlebel.com
Sat Jul 24 23:13:28 CEST 2004


Well, os.startfile( path_to_file ) is exactly what I was looking for.

Thanks! Bernard

----- Original Message ----- From: "Alan Gauld" <alan.gauld at blueyonder.co.uk> To: "Bernard Lebel" <python at bernardlebel.com>; <tutor at python.org> Sent: Saturday, July 24, 2004 8:25 PM Subject: Re: [Tutor] Executing dos .bat file with Python script

> Let say I have a python script that write a .bat file, with the commands and > arguments. Now how can I use that same python script to actually execute the > .bat file in the Windows environment? Any direction would be appreciated.

Use os.system() or os.popen() if you want to read the output... Alan G.



More information about the Tutor mailing list