The site module is automatically imported when the interpreter starts and is used to perform sitewide initialization of packages and to set the default Unicode encoding. The module works by first creating a list of up to four directory names created from the values of sys.prefix and sys.exec_prefix. On Windows, the list of directories is as follows:
[ sys.prefix, sys.exec_prefix ]
On UNIX, the directories are as follows:
[ sys.prefix + ' lib/pythonvers/site-packages , sys.prefix + ' lib/site-python , sys.exec_prefix + ' lib/pythonvers/site-packages , sys.exec_prefix + ' lib/site-python ]
For each directory in the list, a check is made to see whether the directory exists. If so, it’s added to the sys.path variable. Next, a check is made to ...