Open certik opened 4 days ago
Maybe this?
import subprocess as sp
def run_cmd(cmd, cwd=None):
print(f"+ {cmd}")
process = sp.run(["shell", "-c", cmd], cwd=cwd)
if process.returncode != 0:
print("Command failed.")
exit(1)
Yes, that's what I would like --- but we need to implement -c
first.
I want to replace this code:
with an equivalent code that however calls
shell
to execute the above command, notcmd.exe
. Currently I get:What's the best way to do that?