Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 5738  / 1 Year ago, sat, december 31, 2022, 10:26:37

I have just installed Python 2.7 and Python 3.2 on my Ubuntu 12.04 (32 bit).



sudo apt-get install python python-doc python3 python3-doc


I opened a Python 3 shell (is it called like that) typing python3 from a terminal.
If I issue the command help('print') everything works fine and I can read the documentation.



However if I open a Python 2.7 shell (python from a terminal) when I type help('print') I get the following message:




no documentation found for 'print'




How can I get to use the documentation in Python 2.7 as well?


More From » 12.04

 Answers
7

This looks like a bug of Python 2 as something like help("dir") works properly. It probably does not work because print is a special keyword, unlike Python 3. Stick to Python 3 or run the following command instead of help("print"):



help("__builtin__.print")

[#33585] Sunday, January 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rtbrbab

Total Points: 461
Total Questions: 126
Total Answers: 117

Location: Saudi Arabia
Member since Fri, Jul 1, 2022
2 Years ago
rtbrbab questions
Fri, May 5, 23, 14:22, 1 Year ago
Tue, Nov 16, 21, 14:41, 2 Years ago
Thu, Mar 23, 23, 20:47, 1 Year ago
Sat, Jun 18, 22, 21:36, 2 Years ago
;