<分区>
所以我正在查看模块的 help() 文档,但很快意识到阅读小输出框中的文档非常乏味。因此,我尝试将 help() 文档粘贴到另一个文件以便更清晰地阅读。
myfile = open("file.txt","w")
myfile.write(str(help(random)))
myfile.close()
它没有编写文档,而是粘贴在 None
中。
有什么办法吗?
标签 python python-3.x
<分区>
所以我正在查看模块的 help() 文档,但很快意识到阅读小输出框中的文档非常乏味。因此,我尝试将 help() 文档粘贴到另一个文件以便更清晰地阅读。
myfile = open("file.txt","w")
myfile.write(str(help(random)))
myfile.close()
它没有编写文档,而是粘贴在 None
中。
有什么办法吗?
最佳答案
关于python - 如何将 help() 文档写入 Python 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51749548/
相关文章:
python - Django 'WSGIRequest' 对象没有属性 'Post'
python - 使用 Python 在 Mac 上使用 Windows 身份验证访问 Microsoft SQL Server
python - Python 3 源文件支持哪些文件编码?
python - Python 3 中 input() 的语法错误
python - 使用 Perl 的 B::Concise 之类的东西转储 Python opttree?
python - 合并 pandas 数据框,交替行而不对行进行排序
django - 无法让 sql server 与 django azure web 应用程序一起使用