Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从“Learning python the hard way”中学习python。要使用 pydoc,我被要求在终端中输入以下内容:
python -m pydoc xxx
我想知道-m这里的意思。我用谷歌搜索了很多,但找不到任何答案。
-m
它基本上查看sys.path并加载模块(作为参数给出)并将其内容作为__main__模块执行。有关详细信息,请参阅手册页。
sys.path
__main__