I am trying to run the program 220_beta_1e-2_47_53ND.py using subprocess.run(). But the program doesn't run. Can somebody please help?
import subprocess
import sys
subprocess.run(['python3.9.7 220_beta_1e-2_47_53ND.py'],shell=True)
I am trying to run the program 220_beta_1e-2_47_53ND.py using subprocess.run(). But the program doesn't run. Can somebody please help?
import subprocess
import sys
subprocess.run(['python3.9.7 220_beta_1e-2_47_53ND.py'],shell=True)
When the argument to subprocess.run() is a list, the command and arguments should be separate list elements, not a single string. You also shouldn't use shell=True -- that's only used when you supply a single string and it uses shell syntax that needs to be processed.
subprocess.run(['python3.9.7', '220_beta_1e-2_47_53ND.py'])