On Wed, Mar 10, 2010 at 3:20 PM, Armstrong, Richard J. < [email protected]> wrote:
> Hello all, > > > > This is my first post to the [email protected] mailing list. I am in the > process of switching from Matlab to Python and there is one task that I am > having a hard time doing and cannot find the answer on the web. I want to > write a script in python that will open up a windows dos program, send three > inputs (file names) into program and then run it. I know one way to open up > the dos program with os.system(r”c:\shake91.txt”) but cannot do the rest. > Use the subprocess module: http://docs.python.org/library/subprocess.html untested, but should work: subprocess.Popen([r'c:\shake91.txt', 'param1', 'paramN-1', 'paramN']) if you want to communicate with the process you can add , stdout=subprocess.PIPE, stdin=subprocess.PIPE) to the function call. Check the docs for more info. HTH, Wayne
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
