我希望你能提供标准库中所有模块的列表。
至于关键字,我通过以下方式获取它们:
import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
对于内置函数:
>>> dir(__builtins__)
['ArithmeticError', ..., 'super', 'tuple', 'type', 'vars', 'zip']
如何将相同的操作应用于在 Python 官方文档中找到的其他标准库名称。
# my desired result is this
['colletions', 'datetime', 'os', ... ]
# So will check them for reference anytime and anywhere.
help('modules')
将会得到已安装模块的列表。 - cs95