Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get pydoc command working in Windows 7 cmd?

I'm learning to program Python from the "Learning Python the Hard Way". On one of the chapters it tells me to use pydoc command. The windows 7 cmd failed miserably with that command.

When I typed in pydoc raw_input() on cmd following error codes were generated:

'pydoc' is not recognized as internal or external command,
operable program or batch file.

I've looked back previous two questions on same issue:

  1. Pydoc is not working (Windows XP)
  2. How to get pydoc command working in Windows?

So far I have created a pydoc.bat with following line

@python c:\Python26\lib\pydoc.py %*

and saved it in C:\python27\Tools\Scripts.

I've also tried to change the PATH to C:\python27\Lib. I called the two variables python and pydoc because I'm not really sure I set the PATH correctly.

It's still not working.

What did I do wrong?

like image 862
Jordan Avatar asked Apr 23 '11 06:04

Jordan


2 Answers

To get help on python when in the PowerShell window, type:

python -m pydoc raw_input

substituting your function name for raw_input.

like image 182
Mary Meerschaert Avatar answered Oct 14 '22 14:10

Mary Meerschaert


Hey I know this post is a bit old, but I wanted to let you (and anyone else out there) know about this:

C:\Python27\Tools\scripts\pydocgui.py

It sets up a webserver on localhost:7464. Simply visit the address in your browser and you have access to pydoc :) Hope this helps someone

like image 4
Derek Schaefer Avatar answered Oct 14 '22 16:10

Derek Schaefer