2011-08-30 38 views
3
def myfunc(): 
    """ My docstring """ 
    print "hello" 

help(myfunc) 

我得到python docstrings不工作?

'more' is not recognized as an internal or external command, 
operable program or batch file. 

64位Windows 7,Python 2.6中

+3

为什么你没有[更多](http://www.computerhope.com/morehlp.htm)? – Keith

+1

这不是一个Python问题。这只是一个Window问题。 –

+0

您可以指定如何从命令行执行脚本吗? –

回答

2

Python's help() function尝试,你的情况,执行more命令。它应该是这个样子,安装更多的时候:

>>> help(myfunc) 
Help on function myfunc in module __main__: 

myfunc() 
    My docstring 

但你也可以做

>>> print myfunc.__doc__ 
My docstring 

阅读文档字符串。

1

我认为问题不在于你的Windows操作系统没有more但Windows 7的UAC(用户访问控制)中运行你的命令行窗口中user mode代替admin mode.为了解决这个问题,运行cmd以管理员身份然后从该窗口运行python。这应该照顾它。我假设你已经找到more程序C:\Windows\System32\more.com