You can usually find the source files for the main python modules in the python installation folder itself. For example, on linux I can find the source code for the os module, which is a pretty popular python module in this place:
/usr/lib/python2.7/os.py
If you are on windows , this is usually C:\python27\lib , but you can check it out for yourself by running which python in the case of linux and where python in the case of windows .
source share