Python basic 1 origin, type, pros and cons, installation environment

Source: Internet
Author: User

Python basic 1 origin, type, pros and cons, installation environment

First, Past Life

The founder of Python is Guido van Rossum (Guido van Rossum), developed in 1989. Python is ranked fifth in the latest programming language rankings this year. What internet companies use Python extensively is: automated operations , automated testing , Big Data analytics, crawlers, Web, and more.

Python has become a popular language in the fields of machine learning, deep learning, big data analysis, and so on, due to the simplicity and efficiency of Python's natural advantages. For IT development engineers, Python has become one of the essential skills.

1.python C # PHP Java and C's relationship

C Language: Code compiled to get machine code, machine code on the CPU directly executed, each code control an instruction, machine code is the computer language.

Other languages: The code compiles the bytecode, the virtual machine executes the bytecode into the machine code, and then executes on the CPU, a step further, so these languages become high-level languages.

Advantages and disadvantages of 2.python

The language of A.python and C Python was developed by C.

For use: Python's class library is complete and concise, if you want to achieve the same functionality, Python 10 lines of code can be solved, C may need 100 lines or more, Python does not need to manipulate memory, there is a famous saying-"Life is too short, I learn Python"
For speed: Python runs faster than C, slightly less because the compilation is a step more.

  B.python and Java, C #, etc.

For use with: Linux original Python, no other languages; The above languages have a very rich class library support, so in the automation operation of the dominant, do not need to install software
For speed: Python may be slightly slower in speed because of its relatively weak multithreading aspect

So, there is no essential difference between Python and other languages, other differences are: good at a field, rich in talent, preconceived.

Types of 3.Python

Mainly divided into CPython, pypy, other Python

CPython is the official version of Python, implemented in C, and most widely used, the CPython implementation converts the source file (py file) into a bytecode file (PYc file) and then runs on the Python virtual machine.

PyPy is a weak and optimized version of Python multithreading, code execution speed than CPython 0.15-6.9 times times faster, to pay attention to, is the trend of the future.

Other python, mainly Jython, IronPython, Rubypython, and so on, the difference is that the language version of the interpreter that compiles the Python code, the grammar rules are unified, but because of its compilation process a step more, so the execution speed is inferior to CPython.

PyPy, the Python bytecode is further processed on the basis of Python, which improves execution speed!

Second, Pyth oninstallation

Install Python

Windows:

1、下载安装包

https://www.python.org/downloads/

2、安装

默认安装路径:C:\python27

3、配置环境变量

【右键计算机】--》【属性】--》【高级系统设置】--》【高级】--》【环境变量】--》【在第二个内容框中找到 变量名为Path 的一行,双击】 --> 【Python安装目录追加到变值值中,用 ; 分割】

如:原来的值;C:\python27,切记前面有分号

Linux:

无需安装,原装Python环境

ps:如果自带2.6,请更新至2.7

Http://www.cnblogs.com/liujianzuo888/p/5014847.html

Update Python

Windows:

Uninstalling the installation directly

Linux:

Linux Yum relies on its own python, to prevent errors, the update here is actually to install a python

查看默认Python版本

1 python -V

  

1、安装gcc,用于编译Python源码

1 yum installgcc

  

2、下载源码包,https://www.python.org/ftp/python/

3、解压并进入源码文件

4、编译安装

12345 ./configuremake all makeinstall

 

5、查看版本

1 /usr/local/bin/python2.7 -V

  

6、修改默认Python版本

123 mv/usr/bin/python /usr/bin/python2.6 ln-s /usr/local/bin/python2.7 /usr/bin/python

  

7、防止yum执行异常,修改yum使用的Python版本

123 vi/usr/bin/yum将头部 #!/usr/bin/python 修改为 #!/usr/bin/python2.6

  

Python basic 1 origin, type, pros and cons, installation 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.