推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xshell
V2EX  ›  Python

python 中的-m 参数是起什么作用呢·?

  •  
  •   xshell · Aug 27, 2015 · 16238 views
    This topic created in 3936 days ago, the information mentioned may be changed or developed.
    17 replies    2017-07-12 00:49:20 +08:00
    xshell
        1
    xshell  
    OP
       Aug 27, 2015
    如: python -m SimpleHTTPServer 8080 中的-m 是起什么作用呢·~
    expkzb
        2
    expkzb  
       Aug 27, 2015
    -m module-name
    Searches sys.path for the named module and runs the correspond-
    ing .py file as a script.
    imxiaozhi
        3
    imxiaozhi  
       Aug 27, 2015
    -m mod : run library module as a script (terminates option list )
    funagi
        4
    funagi  
       Aug 27, 2015
    推荐楼主读一下
    python --help
    man python
    leavic
        5
    leavic  
       Aug 27, 2015
    一个用搜索引擎和内置帮助文档就可以解决的问题,以至于你自己都觉得只需要标题不需要内容就可以了,问这种问题真的好吗?
    zog
        6
    zog  
       Aug 27, 2015
    导入标准库中一个模块。
    xshell
        7
    xshell  
    OP
       Aug 27, 2015
    呃~~~谢谢楼上的各位呀。
    v23x 这里还是很不错的,至少发帖子很快就有人回复啦~~~
    terry3rd
        8
    terry3rd  
       Aug 27, 2015
    -m 的意思是 RTFM 。
    fullpowers
        9
    fullpowers  
       Aug 27, 2015
    @xshell V2EX ——— way to explore 和 way too extreme
    bdbai
        10
    bdbai  
       Aug 27, 2015 via iPhone
    darnurash
        11
    darnurash  
       Aug 27, 2015 via Android
    RTFM
    julyclyde
        12
    julyclyde  
       Aug 27, 2015
    @zog 不必须是标准库
    zog
        13
    zog  
       Aug 27, 2015
    @julyclyde 嗯。多谢提醒。
    weyou
        14
    weyou  
       Aug 27, 2015
    运行指定的模块,如果模块的名字是 foo, 可以在模块中建一个文件叫比如 foo/__main__.py,
    python -m foo
    就是运行这个__main__.py 。 适用于一些希望可以单独运行执行某些功能的模块
    xshell
        15
    xshell  
    OP
       Aug 27, 2015
    @weyou 谢谢呀。
    XDMonkey
        16
    XDMonkey  
       Jul 12, 2017
    @weyou 请问一下 挖个坟 模块中建文件? py 中建立 py? 怎么建 不是很懂
    weyou
        17
    weyou  
       Jul 12, 2017 via Android
    @XDMonkey 这里的模块指的是 package,也就是一个文件夹
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 84ms · UTC 09:05 · PVG 17:05 · LAX 02:05 · JFK 05:05
    ♥ Do have faith in what you're doing.