search

Home  >  Q&A  >  body text

linux - python -m参数

平时自己安装都是直接pip install安装
但今天看到一个python -m pip install pymongo,请问这个-m有什么作用吗?

迷茫迷茫2786 days ago768

reply all(2)I'll reply

  • 黄舟

    黄舟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

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:27:26

    You can refer to: http://www.cnblogs.com/xuewei...

    reply
    0
  • Cancelreply