有没有办法安装 python 文档,使其像联机帮助页一样可用? (我知道您可以下载文档的源文件并在 vim 中阅读它们,使用 less 或其他任何东西,但我正在考虑一些不那么手动的东西。不想自己动手。)
原文由 Var87 发布,翻译遵循 CC BY-SA 4.0 许可协议
有没有办法安装 python 文档,使其像联机帮助页一样可用? (我知道您可以下载文档的源文件并在 vim 中阅读它们,使用 less 或其他任何东西,但我正在考虑一些不那么手动的东西。不想自己动手。)
原文由 Var87 发布,翻译遵循 CC BY-SA 4.0 许可协议
它不是文档的精确副本,而是内置的 help()
函数。
在交互式 python 会话中,您只需调用 help(whatever_you_want_to_read_about)
,例如:
>>> help(all)
Help on built-in function all in module builtins:
all(...)
all(iterable) -> bool
Return True if bool(x) is True for all values x in the iterable.
If the iterable is empty, return True.
或者,您可以像这样启动交互式帮助会话:
C:\Users\Rawing>python -c "help()"
Welcome to Python 3.4! This is the interactive help utility.
help>
然后只需键入您想了解的函数/类/模块:
help> all
Help on built-in function all in module builtins:
all(...)
all(iterable) -> bool
Return True if bool(x) is True for all values x in the iterable.
If the iterable is empty, return True.
原文由 Aran-Fey 发布,翻译遵循 CC BY-SA 3.0 许可协议
4 回答4.5k 阅读✓ 已解决
1 回答3.2k 阅读✓ 已解决
4 回答3.8k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
1 回答4.4k 阅读✓ 已解决
1 回答3.9k 阅读✓ 已解决
1 回答2.8k 阅读✓ 已解决
如果这是您想要的,我不知道,但您可以在 IDLE 中执行的所有操作都可以在命令行上执行。例子:
这样您就可以访问文档