Python Past and Present
Python founder of Guido van Rossum (Guido van Rossum). During Christmas 1989, Guido van Rossum in Amsterdam in order to pass the time, determined to develop a new script interpreter, ABC language as an inheritance.
Why is Python rather than other languages?
C and Python, Java, C #, etc.
C language: code is compiled machine code to obtain, directly in the machine code executed on the processor, each instruction control CPU work
Other Languages: obtained code is compiled byte code, virtual machine executing byte code and then converted into machine code executed on a processor after
Python Python and C is the language developed from C
For use: Python library complete and simple to use, if you want to achieve the same function, Python 10 lines of code can solve, C may need 100 lines or more.
For speed: Python running speed compared with C, absolute force It is slow
Python and Java, C #, etc.
For: Linux original Python, no other language; the language has more than a few very rich class library support
for speed: Python in speed may slightly less
So, Python and other languages no essential difference, other differences: a good field, rich talent, preconceptions.
Python species
- Cpython
official version of Python, using the C language, the most widely used, CPython will realize the source file (py file) into byte code file (pyc files), then run on Python virtual machine. - Jyhton
Python Java implementation, Jython Python code will be dynamically compiled into Java byte code, and then runs on the JVM. - IronPython
Python C # implementation, the IronPython C # Python code into byte code, and then run on the CLR. (Jython and similar) - PyPy (special)
Python implemented Python, Python bytecode will compile the bytecode into machine code. - RubyPython, Briton ...
python environment
Installing Python
Windows:
- Download Python Package
-
https:
/
/
www.python.org
/
downloads
/
-
- Installing Python
-
默认安装路径:C:\python27
-
- Configuration python environment
- The configuration of the Python environment variable can be
linux:
Linux comes with the yum-dependent Python, in order to prevent errors, here is the update actually install a Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
查看默认Python版本
python
-
V
1
、安装gcc,用于编译Python源码
yum install gcc
2
、下载源码包,https:
/
/
www.python.org
/
ftp
/
python
/
3
、解压并进入源码文件
4
、编译安装
.
/
configure
make
all
make install
5
、查看版本
/
usr
/
local
/
bin
/
python2.
7
- V
6
、修改默认Python版本
mv
/
usr
/
bin
/
python
/
usr
/
bin
/
python2.
6
ln
-
s
/
usr
/
local
/
bin
/
python2.
7
/ usr / bin / python
7
、防止yum执行异常,修改yum使用的Python版本
vi
/
usr
/
bin
/
yum
将头部
#!/usr/bin/python 修改为 #!/usr/bin/python2.6
|