calling a .exe from Python

Nick Craig-Wood nick at craig-wood.com
Wed Jun 25 04:32:17 EDT 2008


evidentemente.yo <evidentemente.yo at gmail.com> wrote:
>  On 24 jun, 14:32, Nick Craig-Wood <n... at craig-wood.com> wrote:
> > Probably what you want is this...
> >
> > from subprocess import call
> >
> > rc = call(["mypath/myfile.exe",arg1,arg2])
> >
> > rc will contain the exit status
> >
> > See the subprocess module for more things you can do
>
>  Hey, thank you very much!!!:D
> 
>  Would it matter if my .exe doesn't return any value? would it return
>  like an "ok" or something???

Your exe will return a value (it is part of the OS) but you can ignore
it if you want.  Just use

call(["mypath/myfile.exe",arg1,arg2])

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list