How to get Python 2.6 documentation of the future-imported print() function?
Question
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.)
La solution
Unfortunately there's no shortcut:
$ python -c 'from __future__ import print_function; help(print)'
Autres conseils
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...
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow