Pydoc 不工作 (Windows XP) [英] Pydoc is not working (Windows XP)

查看:25
本文介绍了Pydoc 不工作 (Windows XP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Windows XP 和 Python 2.7,我尝试通过终端运行pydoc".不幸的是它不起作用.

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)

我输入的内容:

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

我的结果(这是德语,大致翻译为命令pydoc"要么拼写错误,要么找不到.):

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. 

我做错了什么?

顺便说一句,我刚刚开始使用 Zed ShawsLearn Python the Hard Way"自学编程,这是我使用 Google 真的无法弄清楚的第一个问题.我开始相信是 Windows 而不是我...(因为穷得买不起 Mac,也不敢学习 Linux).

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

推荐答案

pydoc 实际上是一个 Python 脚本(因此,在 Windows 上,您需要查找 pydoc.py),并且默认情况下它不会添加到 Windows %PATH% 中(因此您需要提供完整路径名).

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

尝试从命令行运行 c:\Python27\Lib\pydoc.py.

对于 Python 文档的图形界面,您可能希望改为运行 c:\Python27\Tools\Scripts\pydocgui.pyw(从命令行或从 Windows 资源管理器).这会在您的本地 PC 上启动 pydoc 的网络服务器,以便您可以通过网络浏览器访问文档.

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.

这篇关于Pydoc 不工作 (Windows XP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆