-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)
1
  • 1
    Check this answer. Commented Aug 13, 2019 at 9:43

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

1 Comment

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")

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.