I would like to run a command in Python Shell to execute a file with an argument.
For example: execfile("abc.py")
but how to add 2 arguments?
I would like to run a command in Python Shell to execute a file with an argument.
For example: execfile("abc.py")
but how to add 2 arguments?
Besides
subprocess.call
, you can also usesubprocess.Popen
. Like the followingsubprocess.Popen(['./script', arg1, arg2])
If you want to run the scripts in parallel and give them different arguments you can do like below.
Actually, wouldn't we want to do this?
You can't pass command line arguments with
execfile()
. Look atsubprocess
instead.