python soucrce code 在VC 6.0下编译老是报错,上网无果,因此不得不在linux下编译,以便于后面的学习
os: ubuntu
python source code url: http://101.44.1.3/download/18941080/23561362/3/bz2/183/135/1357635138743_391/Python-2.7.3.tar.bz2
step:
1 unzip:
tar jxvf Python-2.7.3.tar.bz2
2 read reame
layout of source code:
Demo/ Demonstration scripts, modules and programs
Doc/ Documentation sources (reStructuredText)
Grammar/ Input for the parser generator
Include/ Public header files
LICENSE Licensing information
Lib/ Python library modules
Mac/ Macintosh specific resources
Makefile.pre.in Source from which config.status creates the Makefile.pre
Misc/ Miscellaneous useful files
Modules/ Implementation of most built-in modules
Objects/ Implementation of most built-in object types
PC/ Files specific to PC ports (DOS, Windows, OS/2)
PCbuild/ Build directory for Microsoft Visual C++
Parser/ The parser and tokenizer and their input handling
Python/ The byte-compiler and interpreter
README The file you're reading now
RISCOS/ Files specific to RISC OS port
Tools/ Some useful programs written in Python
pyconfig.h.in Source from which pyconfig.h is created (GNU autoheader output)
configure Configuration shell script (GNU autoconf output)
configure.in Configuration specification (input for GNU autoconf)
install-sh Shell script used to install files
setup.py Python script used to build extension modules
3in minipy directory : ../configure --prefix=/home/Desktop/cpython/Python2.7.3/minipy
4 make
5 sudo -i
6 make install
7 run mypython
root@ubuntu-virtual-machine:/home/ubuntu/Desktop/cpython/Python-2.7.3# python
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@ubuntu-virtual-machine:/home/ubuntu/Desktop/cpython/Python-2.7.3# ./python
Python 2.7.3 (default, Feb 25 2013, 22:21:51)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
后续我们就可以自己修改源代码,进行定制
when you modify your source code ,you should run ./configure & make ,
that is all
ref:
python readme