I have read the python document about subprocesses, but the argument preexec_fn for subprocess.Popen can only point to a function with no argument.
Now I want to call a function with two arguments just like what preexec_fn does, I’ve tried to use global variables, but it doesn’t work.
How can I do that?
You can pass the arguments using
functools.partialor alambda: