Next / Previous / Contents / TCC Help System / NM Tech homepage

28.6. sys: Universal system interface

The services in this module give you access to command line arguments, standard input and output streams, and other system-related facilities.

argv

sys.argv[0] is the name of your Python script, or '-c' if in interactive mode. The remaining elements, sys.argv[1:], are the command line arguments, if any.

builtin_module_names

A list of the names of the modules compiled into your installation of Python.

exit(n)

Terminate execution with status n.

modules

A dictionary of the modules already loaded.

path

The search path for modules, a list of strings in search order.

Note: You can modify this list. For example, if you want Python to search directory /u/dora/python/lib for modules to import before searching any other directory, these two lines will do it:

import sys
sys.path.insert(0, "/u/dora/python/lib")

platform

A string identifying the software architecture.

stderr

The standard error stream as a file object.

stdin

The standard input stream as a file object.

stdout

The standard output stream as a file object.