[Tutor] pydoc?

Lowell Tackett lowelltackett at yahoo.com
Fri Jun 18 23:42:48 CEST 2010


>From the virtual desk of Lowell Tackett  


--- On Fri, 6/18/10, Andrew Martin <amartin7211 at gmail.com> wrote:

From: Andrew Martin <amartin7211 at gmail.com>
Subject: [Tutor] pydoc?
To: tutor at python.org
Date: Friday, June 18, 2010, 1:53 PM

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 called "How
 to Think Like a Computer Scientist: Learning with Python v2nd Edition 
documentation" (http://openbookproject.net/thinkcs/python/english2e/ch04.html).
 However, I am having some trouble. 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



Can anyone help me out?

Thanks

You're getting awfully close.  Again, assuming that you are in python; at the prompt type:

         pydoc modules

which will list all the module names, but...it's more than one screen and you can't go backwards, so you lose the first half.  So, type (instead):

         pydoc modules > made-upfilename

and you will create an ascii file (with the name you gave it) containing all the pydoc names in it.  The easiest way to open that file is:

         less made-upfilename

"less" is a bash command that opens files for reading.  As you'll see, it will allow you to scroll forward in the file (space bar) or backwards, with the "b" key.  To close that file, just type a "q" for quit.  And while your at it, while at bash's ($) the command line, type in "man less" w/o the quotes (that stands for "manual for 'less'"), and begin learning how the bash commands work, and how you can access great info as to how they work.

Good luck.



      



More information about the Tutor mailing list