More sys

A Byte of Python 

Go to the Table of Contents. Visit the Gifcom web site.

The sys.version string gives you information about the version of Python that you have installed. The sys.version_info tuple gives an easier way of enabling Python-version specific parts of your program.

[swaroop@localhost code]$ python
>>> import sys
>>> sys.version
'2.3.4 (#1, Oct 26 2004, 16:42:40) \n[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]'
>>> sys.version_info
(2, 3, 4, 'final', 0)

For experienced programmers, other items of interest in the sys module include sys.stdin, sys.stdout and sys.stderr which correspond to the standard input, standard output and standard error streams of your program respectively.