Sep-04-2017, 12:54 AM
I've Googled this but it's been a long day and maybe some kind soul will share some simple example code so I can get out of this chair for today :-)
I need simple examples of launching an external .exe file and passing it an argument or arguments?
I think you use subprocess and pOpen but I've yet to find a simple example for say the following...
If run from the command line...
# example 1 - launch a program and pass it some text as an argument
> myprog.exe arg1
# example 2 - launch a program and pass it a file
> vlc test.wav
# example 3 - launch a program and pass it some arguments and get the results
> set /a 2+3
> 5
How to do this from Python?
thanks for any help
I need simple examples of launching an external .exe file and passing it an argument or arguments?
I think you use subprocess and pOpen but I've yet to find a simple example for say the following...
If run from the command line...
# example 1 - launch a program and pass it some text as an argument
> myprog.exe arg1
# example 2 - launch a program and pass it a file
> vlc test.wav
# example 3 - launch a program and pass it some arguments and get the results
> set /a 2+3
> 5
How to do this from Python?
thanks for any help