Compile Python2.7 source code in Windows and Python 2.7 source code.

Source: Internet
Author: User

Compile Python2.7 source code in Windows and Python 2.7 source code.

This article begins with a series of articles and provides a deep understanding of the Python source code. It is a long-term task to read the reading notes in the book "Python source code analysis. There are three parts in total: Python object model, Python virtual machine, Python module dynamic loading and memory management.

Python version: Python-2.7.10

Compilation tool: Microsoft Visual Studio 2013

The Python version and VS version are relatively matched. Higher Python versions do not match higher VS versions. You may need to modify some source code and set various compilation options, therefore, this series does not use higher Python and VS versions.

Preparation

Download Python-2.7.10 source code from the Python Official Website

 

The decompressed directory is the content in the Python-2.7.10 directory:

Compile

    • (1) decompress Python-2.7.10
    • (2) enter the Pcbuild folder, use vs 2013 to open pybuild. sln (vs solution), and enter the vs 2013 IDE environment.

    • (3) Right-click the Python project and select Set as StartUp Porject.

    • (4) Right-click solution-> Properties
    • Configuration in the upper left corner: Release Debug (similar to Release)
      • Project context: select only python/pythoncore
    • (5)

      First, compile make_buildinfo and make_versioninfo.

      Right-click make_buildinfo, and choose make_versioninfo future. Only the project region is used for re-generation.

    • (6) Compile the solution and generate the python_d.exe and python27_d.dll files in the PCbuild folder. You can double-click python_d.exe to enter the python command line environment.
  •  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.