passing command line arguments to executable

Simon Brunning simon at brunningonline.net
Sun Apr 4 07:32:33 EDT 2010


On 3 April 2010 18:20, mcanjo <mcanjo at gmail.com> wrote:
> I tried doing the following code:
>
> from subprocess import Popen
> from subprocess import PIPE, STDOUT
> exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr =
> STDOUT)
> exefile.communicate('MarchScreen.pmm\nMarchScreen.out')[0]
>
> and the Command Prompt opened and closed, no exceptions were generated
> but the program didn't run. Am I doing something wrong?

Have you tried running pmm.exe from the command line? What does that
look like? Does it matter what the current working directory is at the
time?

-- 
Cheers,
Simon B.



More information about the Python-list mailing list