[perl-python] 20050113 looking up syntax

Xah Lee xah at xahlee.org
Fri Jan 14 05:42:37 EST 2005

while programing in Python, one can lookup syntax or info for keywords
or modules within Python.

In the command line, type


to get into the python interactive program. then type
>From there one can type any keyword or module name to find out the
syntax or info. Everything is self-contained and self-explanatory.

to exit help, type control-d.

if you haven't tried already, you can type 1+1 while running python.
The result will be displayed interactively. So in this way, Python can
be used as a calculator.


for perl syntax lookup, use perldoc in the command line. For example:
perldoc perl

use 'perldoc -f functionName' for specific function. example:
perldoc -f qq

note that keywords cannot be looked up with -f. For basic keywords like

if, while..., use
perldoc perlop

Master 'perldoc perl' as a way to get familiar of what info are
available and what subroutine or aspect of perl is in what section of
the documentation associated with what documentation name abbreviation.

Master 'perldoc perldoc' to know all its power of options and
flexibility. If you use emacs, in particular you want to add the -t
option. Master the unix text editor vi to learn the navigation system
of perldoc. The basics are: control-f for page down, control-v for page

up, q for exit. Also, one may wish to peruse 'perldoc perlfaq' to
acquaint yourself about the preamble of nine volumes of perl's FAQ.


Note: this post is from the Perl-Python a-day mailing list at
to subscribe, send an email to perl-python-subscribe at yahoogroups.com
if you are reading it on a web page, program examples may not run
because they've been changed by yahoo.com or google.com.
  xah at xahlee.org

More information about the Python-list mailing list