python -m 参数的含义

首先可以在命令行用python -h,获取帮组信息。

python -h

 
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-b     : issue warnings about str(bytes_instance), str(bytearray_instance)
         and comparing bytes/bytearray with str. (-bb: issue errors)
-B     : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x
-c cmd : program passed in as string (terminates option list)
-d     : debug output from parser; also PYTHONDEBUG=x
-E     : ignore PYTHON* environment variables (such as PYTHONPATH)
-h     : print this help message and exit (also --help)
-i     : inspect interactively after running script; forces a prompt even
         if stdin does not appear to be a terminal; also PYTHONINSPECT=x
-I     : isolate Python from the user's environment (implies -E and -s)
-m mod : run library module as a script (terminates option list)

由输出可以看到:

python -m 参数的含义是导入模块(module的首字母)。

例如:

python -m spacy download en_core_web_sm

上述指令的含义就是,在命令行导入spacy模块。

余后的参数:download en_core_web_sm 是spacy的参数

顺便说一下:spaCy是用于高级自然语言处理的开源软件库,作为命令行参数,全部小写(特别是在Mac和Linux系统下)。

 

 

 

 

你可能感兴趣的:(Python学习)