Domanda

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.)

È stato utile?

Soluzione

Unfortunately there's no shortcut:

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

Altri suggerimenti

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...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top