Closed PeterJCLaw closed 3 years ago
The runpy package is what implements python -m X.py and python X.py running, so it's pretty much designed for what we're trying to do here.
runpy
python -m X.py
python X.py
The main reason to switch to it is that it preserves the original file name of the code being run and thus plays much better with debuggers.
The
runpy
package is what implementspython -m X.py
andpython X.py
running, so it's pretty much designed for what we're trying to do here.The main reason to switch to it is that it preserves the original file name of the code being run and thus plays much better with debuggers.