从dos调用安装在python的site-packages中的模块

时间:2012-02-26 15:37:16

标签: python dos

如何从DOS / CMD提示符调用已安装的python模块到文件夹site-packages中

我希望有一个很好的解决方案,比如

python module.py arg1 arg2

目前我有

python D:\Folder\Folder\module.py Arg1 Arg2

现在很好但我会在其他机器上安装这些模块,我知道python路径但不一定是包路径。我想知道做这种事的最好方法。

1 个答案:

答案 0 :(得分:3)

请参阅Python命令行实用程序的文档:

-m <module-name>
     Search sys.path for the named module and execute its contents as the __main__ module.

休息在这里:http://docs.python.org/using/cmdline.html#cmdoption-m