This article began a series of articles, in-depth understanding of the Python source code, reading the "Python Source code Analysis," a book reading notes, is a long-term work. There are three parts: Python object model, Python virtual machine, Python module dynamic loading and memory management.
Python version: Python-2.7.13
Compilation tools: Microsoft Visual Studio EnterPrise
Get ready
Download Python-2.7.13 source on the Python website
Downloaded after the extracted directory for Python-2.7.13, directory content:
Compile
-
- (1) Decompression Python-2.7.13
(2) Enter the Pcbuild folder and use vs 2017 to open the Pybuild.sln (vs solution) to the VS. IDE environment
(3) Right-click solution ' Pcbuild ' ⇒ properties
-
(4) First compile make_buildinfo and Make_versioninfo
Right-click Make_buildinfo/make_versioninfo⇒ only for project ⇒ rebuild only
- (5) Compile this solution and eventually generate the Python_d.exe and Python27_d.dll files under the starting Pcbuild folder, double-click Python_d.exe and go to the Python command-line environment.
Windows compiled Python2.7 source code