문제

I use Python 2.6 with the new print() function:

from __future__ import print_function

Now, how can I get pydoc to print a documentation of that function? A simple

$ pydoc print

will print documentation about the 2.6 version of the print function.

(Needless to say, I can find the documentation online but I'd like to be able to access it using pydoc on the command line.)

도움이 되었습니까?

해결책

Unfortunately there's no shortcut:

$ python -c 'from __future__ import print_function; help(print)'

다른 팁

This is probably not what you want, but on my system, I can do pydoc3.2 print as I have both python 2.6 and python 3.2 installed...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top