Python -m switch to run module inside package
问题 I am reading this article. I am wondering why the below statement from the article is correct? As I can use the solution 1 - that is - python -m packA.a2 and it works fine. To give you some context, Solution 1 says: Use absolute imports rooted at the test/ directory (i.e. middle column in the table above). This guarantees that running start.py directly will always work. In order to run a2.py directly, run it as an imported module instead of as a script: change directories to test/ in the