Aug-21-2023, 09:06 PM
Use the
cwd=
keyword argument of subprocess.Popen()
and other functions, for example>>> import subprocess as sp >>> import os >>> sp.run(['ls'], cwd=os.path.expanduser('~'))