سؤال

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