python 文档字符串不起作用?
def myfunc():
""" My docstring """
print "hello"
help(myfunc)
我使用的是
'more' is not recognized as an internal or external command,
operable program or batch file.
Windows 7 64 位、Python 2.6
def myfunc():
""" My docstring """
print "hello"
help(myfunc)
I get
'more' is not recognized as an internal or external command,
operable program or batch file.
Windows 7 64bit, Python 2.6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Python 的 help() 函数 在您的情况下尝试执行 更多命令。当安装更多时,它应该看起来像这样:
但您也可以
阅读文档字符串。
Python's help() function tries to, in your case, execute the more command. It should look something like this, when more is installed:
But you can also do
to read the docstring.
我认为问题不在于您的 Windows 操作系统没有
more
,而是 Windows 7 UAC(用户访问控制)以用户模式
运行您的命令行窗口,而不是管理模式。
要解决该问题,请以管理员身份运行cmd
,然后从该窗口运行 python。那应该解决它。我假设您已经在C:\Windows\System32\more.com
中找到了more
程序I think that the problem is not that your Windows OS doesn't have
more
but that Windows 7 UAC (User Access Control) runs your command line window inuser mode
instead ofadmin mode.
To solve the problem, runcmd
as an administrator and then run python from that window. That should take care of it. I am assuming that you have already located themore
program inC:\Windows\System32\more.com