[Tutor] pydoc?

Alan Gauld alan.gauld at btinternet.com
Sat Jun 19 01:56:10 CEST 2010

"Andrew Martin" <amartin7211 at gmail.com> wrote

> Hey, everyone, I am new to programming and just downloaded Python 
> 2.6 onto
> my windows vista laptop. I am attempting to follow 4.11 of the 
> tutorial
> ....I am trying to use pydoc to search through the
> python libraries installed on my computer but keep getting an error
> involving the $ symbol.
> $ pydoc -g
> SyntaxError: invalid syntax

OK, There are lots of problems hidden within this request.

First, you are on windows Vista and the $ sign is the Linux command
prompt. So you need to use a Windows command console which will
have a prompt that looks something like:


And you dont type the $.
You will find that a lot of programmers prefer Linux to Windows and so
a lot of the documentation tends to be Linux focused. You can usually
find Windows equivalents but it takes a bit of extra thought or
research sometimes.

Get used to using the command console because a lot of programming
tasks are best done there. In programming, GUIs are not always a good

However the error you get looks like a Python error which implies
you are at the pyhon interpreter prompt (>>>). That is not the
right place to be typing pydoc. That needs to be at the OS command
prompt. However, the final problem is that pydoc is not set up to run
from the command prompt - at least not on my PC. So before you
could get that to work you would also need to add the Tools\scripts 
to your path.... The lesson to be learned is that translating 
intended for Linux into Windows is non-trivial.

BTW. The easiest way to start a Windows command prompt - if you don't
have a shortcut on your desktop - is to go to Start->Run and type
CMD in the dialog. Then hit OK.
A black command window should appear.

You'll find more detailed instructions and links to some help
info in the "Getting Started" topic of my tutorial.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list