You have wrapper python script that is calling another python script, currently using os.system('python another.py some-params')
.
You want to be able to debug both scripts and if you use os.system()
you'll loose the debugger, so it does make sense to load the second script using the same interpretor instead of starting another one.
import
doesn't to the expected thing because it does not run the __main__
.
Other variants, like exec()
or runpy
seams to miss the argv
parameters.
What solution do you see for this issue?
I'm looking for a solution that does not require you to modify the another.py
script. Probably this will require to modify the sys.argv
before executing it.