You have a python script shell that calls another python script, currently uses os.system('python another.py some-params') .
You want to be able to debug both scripts, and if you use os.system() , you lose the debugger, so it makes sense to load the second script using the same interpreter, rather than running the other.
import not as expected because it does not start __main__ .
Other options, such as exec() or runpy , skip the argv options.
What solution do you see on this issue?
I am looking for a solution that does not require changing another.py script. You probably need to modify sys.argv to do this.
source share