How can I specify working directory for popen

Is there a way to specify the running directory of command in Python’s subprocess.Popen()?

For example:

Popen('c:\mytool\tool.exe', workingdir="d:\test\local")

My Python script is located in C:\programs\python

Is is possible to run C:\mytool\tool.exe in the directory D:\test\local?

How do I set the working directory for a sub-process?

2 Answers
2

Leave a Comment