- Secret Recipes of the Python Ninja
- Cody Jackson
- 124字
- 2021-06-25 22:14:39
There's more...
On a side note, the -m option indicates that Python is to run the module as a stand-alone script, that is, its contents will be ran within the __main__ namespace. Doing this means you don't have to know the full path to the module, as Python will look for the script in sys.path. In other words, for modules that you would normally import into another Python file can be run directly from the command line.
In the example of running pipenv, the command takes advantage of the fact that Python allows the -m option to run a module directly or allow it to be imported; in this case, pipenv imports venv to create the virtual environment as part of the creation process.
推薦閱讀
- 大話PLC(輕松動漫版)
- Java 開發從入門到精通(第2版)
- Java技術手冊(原書第7版)
- INSTANT CakePHP Starter
- Mastering Unity Shaders and Effects
- Mastering Python High Performance
- Learning Neo4j 3.x(Second Edition)
- 深入淺出RxJS
- Java語言程序設計教程
- Python應用與實戰
- C/C++代碼調試的藝術(第2版)
- Mastering Machine Learning with R
- Visual C++ 開發從入門到精通
- C#從入門到精通(微視頻精編版)
- Python 3.8編程快速入門