Pydoc is not working (Windows XP)

安稳与你 提交于 2019-11-28 10:20:14

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.

for me

% python -m pydoc <params here>

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

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 %*
indre

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

Pandar_H

In Windows,you should type python pydoc.py in this directory(c:\Python27\lib) in the powershell,then you will see what you want.

PS: pay attention to the full path to pydoc.py

  1. Check if path you've added to PATH is in there. Type in command line PATH. If path you've added isn't there then Restart Windows. If it is go next line.

  2. Type pydoc.py instead of pydoc

  3. If you don't want type pydoc module extension every time, just add .PY extension to PATHEXT variable located at the same place as PATH variable does (Computer → Properties → Advanced system settings → Advanced → Environment Variables... → System Variables → PATHEXT). Restart your Windows after adding of extension.

The simplest way to do this would be to change to the Python27/Lib directory and run the command from there, like so:

C:\Documents and Settings\username>cd C:\Python27\Lib

C:\Python27\Lib>python pydoc.py raw_input
Help on built-in function raw_input in module __builtin__:

Just put C:\Python27\Lib in your PATH environment variable and be done with it once and for all. Works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!