平时自己安装都是直接pip install安装
但今天看到一个python -m pip install pymongo,请问这个-m有什么作用吗?
黄舟2017-04-18 10:27:26
python -h
-m mod : run library module as a script (terminates option list)
-m runs the specified module
Commonly used:
Enable static server python -m SimpleHTTPServer 8888
View python documentation python -m pydoc -p 8888
pydoc server ready at http://localhost:8888/
Format json
echo '{"name":"python","version":"2.7"}' | python -m json.tool
{
"name": "python",
"version": "2.7"
}
more