python -m标志的含义 [英] Meaning of python -m flag

查看:110
本文介绍了python -m标志的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

python -m pip install <package>中的-m是什么意思? 或在使用python -m pip install --upgrade pip升级点时.

What does -m in python -m pip install <package> mean ? or while upgrading pip using python -m pip install --upgrade pip.

推荐答案

来自 Python文档

该参数是模块名称,您不能指定文件扩展名(.py). module-name应该是一个有效的Python模块名称,但是实现可能并不总是强制执行此操作(例如,它可能允许您使用包含连字符的名称).

The argument is a module name, you must not give a file extension (.py). The module-name should be a valid Python module name, but the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen).

还允许使用包裹名称.当提供软件包名称而不是常规模块时,解释器将执行. main 作为主模块.这种行为故意类似于处理作为脚本参数传递给解释器的目录和zipfile.

Package names are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute .main as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument.

这篇关于python -m标志的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆