It seems to me python -m myscript and python   myscript do the same thing: running a script.
What is the purpose of using -m? Thanks.
In some cases, especially for very small projects, python script.py and python -m script will be pretty much the same.
The biggest difference is when your module lives in a package and has relative imports. If you have a script that import something like from .module import some_name, you will most likely get a ModuleNotFoundError when you run it with python package/scripy.py. On the other hand, python -m package.script will produce whatever output you expected.
What is the purpose of using `-m`?