[Tutor] Where is sys.py?

Peter Otten __peter__ at web.de
Sun Aug 21 16:10:06 CEST 2011


Lisi wrote:

> If sys.py is a file, it must be somewhere; but I can't find it.  Where is
> it? I would like to look at it.

You are out of luck, there is no sys.py. The sys module is so tightly 
integrated that Python cannot run without it; it has to be part of the 
interpreter and is written in C. 

In general, to see the parts of Python that are written in C you have to 
download the source distribution, but for an occasional glimpse at a 
specific module you can also use an URL like

http://hg.python.org/cpython/file/2.5/Python/sysmodule.c





More information about the Tutor mailing list