I’m calling a command line program in python using the os.system(command) call.
How can I call this command passing a different folder for execution? There is a system call for this? Or I should save the current folder, and, after execution, change restore it.
The
subprocessmodule is a very good solution.It has also arguments for modifying environment variables, redirecting input/output to the calling program, etc.