I want to execute an exe file in script which requires command like this in commandline C:\pathtotool.exe -2 c:\data .
how can i do this in python in windows. Os.system does not work
I want to execute an exe file in script which requires command like this in commandline C:\pathtotool.exe -2 c:\data .
how can i do this in python in windows. Os.system does not work
import subprocess
# Call your exe
subprocess.call('C:\pathtotool.exe -2 c:\data ')
# if you want to print output
p = subprocess.check_output('C:\pathtotool.exe -2 c:\data ')
print p
or
import os
os.system(start 'C:\pathtotool.exe -2 c:\data ')