Cartoon Edmund

Home

Calendar

Contact

Knight Vision

Sitemap



Edmund J. Sutcliffe
Thoughtful Solutions, Creatively Implemented and Communicated

Edmund's Python Quick Reference
- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Click here for a printable version of this page.

python [-diuv] [-c command | script | - ] [args]


     -d   Turn on parser  debugging  output  (for  wizards  only,
          depending on compilation options).

     -i   When a script is passed as first  argument  or  the  -c
          option  is used, enter interactive mode after executing
          the script or  the  command.   It  does  not  read  the
          $PYTHONSTARTUP  file.   This  can  be useful to inspect
          global variables or a stack trace when a script  raises
          an exception.

     -s   Suppress auto-printing of expressions in interactive mode.

     -u   Force stdout and stderr to be totally unbuffered.

     -v   Print a message each  time  a  module  is  initialized,
          showing  the  place  (filename or built-in module) from
          which it is loaded.

     -c command
          Specify the command  to  execute  (see  next  section).
          This  terminates the option list (following options are
          passed as arguments to the command).

     -  anything afterward is passed as options to python script or
        command, not interpreted as an option to interpreter itself.

     script is the name of a python file to execute

     args are passed to script or command (in "sys.argv")

If no script or command, Python enters interactive mode. Uses 
"readline" package for input, if available. 

ENVIRONMENT VARIABLES

PYTHONPATH
Augments the default search path for module files. The format is the same as the shell's $PATH: one or more directory pathnames separated by colons.
PYTHONSTARTUP
If this is the name of a readable file, the Python com- mands in that file are executed before the first prompt is displayed in interactive mode.
PYTHONDEBUG
If non-empty, same as -d option
PYTHONINSPECT
If non-empty, same as -i option
PYTHONSUPPRESS
If non-empty, same as -s option
PYTHONUNBUFFERED
If non-empty, same as -u option
PYTHONVERBOSE
If non-empty, same as -v option

Terms Used

sequence
a string, list or tuple
suite
a series of statements, possibly separated by newlines. Must all be at same indentation level, except for suites inside compound statements
<x>
in a syntax diagram means a token referred to as "x"
[xxx]
in a syntax diagram means "xxx" is optional
x ==> y
means the value of <x> is <y>
x <=> y
means "x is equivalent to y"


Cartoon Edmund

Quick Ref

Tech Tips

Travel Tips

Tech News

Images