Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pydoc is not working (Windows XP)

Using Windows XP and Python 2.7 I tried to run "pydoc" through the terminal. unfortunately it doesn't work.

Since I'm not allowed to post a screenshot (Newbie). Here is what it says (white on black)

What I type:

"C:\Python27>pydoc raw_input  /"pydoc raw_input"

My result (It's German an it roughly translates to"The command "pydoc" is either spelled wrong or couldn't be found.):

Der Befehl "pydoc" ist entweder falsch geschrieben oder konnte nicht gefunden werden. 

What am I doing wrong?

By the way, I just started to teach myself programming using Zed Shaws "Learn Python the Hard Way" and this is the first issue I really can't figure out using Google. I start to believe that it is Windows an not me... (being too broke to afford a Mac and to scared to learn Linux).

like image 958
Twiek Avatar asked Aug 02 '10 21:08

Twiek


4 Answers

for me

% python -m pydoc <params here>

worked. python will look for pydoc.py in the right directories without further ado.

like image 143
akira Avatar answered Oct 24 '22 09:10

akira


pydoc is actually a Python script (so, on Windows, you need to look for pydoc.py), and it's not added to the Windows %PATH% by default (so you need to give a full pathname).

Try running c:\Python27\Lib\pydoc.py from your command line.

Edit: For a graphical interface to Python's documentation, you might want to instead run c:\Python27\Tools\Scripts\pydocgui.pyw (from the command line or from Windows Explorer). This starts pydoc's web server on your local PC so you can access the documentation through your web browser.

like image 41
Josh Kelley Avatar answered Oct 24 '22 09:10

Josh Kelley


There's no pydoc command in Windows. You'll need to specify the full path to pydoc.py. For example to start the pydoc GUI use:

python c:\Python26\lib\pydoc.py -g

If you want to add the pydoc command, create a pydoc.bat file with the following line in it:

@python c:\Python26\lib\pydoc.py %*
like image 2
Dave Webb Avatar answered Oct 24 '22 09:10

Dave Webb


you can also type help() when you are in the Python terminal which gets you to the same page...

http://docs.python.org/library/pydoc.html

like image 2
indre Avatar answered Oct 24 '22 11:10

indre