What is the difference between using the -m
switch and using __main__.py
file in a package - as both allow to run file without the need to specify .py?
Asked
Active
Viewed 70 times
0

variable
- 8,262
- 9
- 95
- 215
-
1`-m` can be used with any importable "thing", not just packages. And there is an obvious difference between `python3 -m my_package` and `python3 /usr/local/lib/python3.7/dist-packages/my_package`. – Giacomo Alzetta Sep 26 '19 at 09:50
-
Can you explain in an answer please – variable Oct 06 '19 at 13:30