-1

generally in PowerShell I running command:

cd C:\Users\aaa\Desktop\File Namee\

then I am executing program with specific parameters:

.\program.exe /F:aa.dvl /PPP_ZZZ

and it works, now my question, how to execute it by python script ? I tried subprocess and os.system but it doesn't work for me.

file = ['C:\\Users\\aaa\\Desktop\\File Namee\\', '.program.exe/F:aa.dvl /PPP_ZZZ']
subprocess.call(file)
Milek
  • 179
  • 3
  • 11

2 Answers2

1

try something like

file = ['C:\\Users\\aaa\\Desktop\\File Namee\\program.exe', '/F:aa.dvl' '/PPP_ZZZ']
subprocess.call(file)

so each parameter as a separate list element.

flackbash
  • 488
  • 2
  • 16
1

Try this os.system("/path/to/exe/File.exe -parameters params")

  • That was working for me: ```os.system(" C:\\Users\\aaa\\Desktop\\File Namee\\program.exe /F:C:\\Users\\aaa\\Desktop\\File Namee\\aa.dvl /PPP_ZZZ") ``` – Milek Aug 13 '19 at 10:04