Learn Python-Lesson 1: Basic Introduction, learn python-Lesson 1

Source: Internet
Author: User

Learn Python-Lesson 1: Basic Introduction, learn python-Lesson 1
Python past and present

The founder of python is Guido van rosum ). During the Christmas period of 1989, Guido fansoum was determined to develop a new script interpreter to pass the time in Amsterdam as an inheritance of the ABC language.

Why Python instead of other languages?C, Python, Java, and C #

C language: the code is compiled to obtain the machine code. The machine code is directly executed on the processor, and each command controls CPU work.

Other languages: the code is compiled to get the bytecode. The virtual machine executes the bytecode and converts it to the machine code, and then runs it on the processor.

Python and C Python are developed by C.

For usage: Python class libraries are complete and simple to use. To implement the same function, Python 10 lines of code can solve the problem, and C may need 100 lines or more.
For speed: Compared with C, Python runs slowly.

Python, Java, and C #

For use: the original Linux Python is not available in other languages; The above languages have very rich class library support
For speed: Python speedPossibleSlightly inferior

Therefore, there is no essential difference between Python and other languages. The other difference is that Python is good at a certain field, rich talents, and preemptible.

Python type
  • Cpython
    Python official version, which is implemented in C language and most widely used. CPython converts the source file (py file) into a bytecode file (pyc file) and runs on a Python virtual machine.
  • Jyhton
    For Java Implementation of Python, Jython dynamically compiles Python code into Java bytecode and runs it on JVM.
  • IronPython
    IronPython compiles Python code into C # bytecode and runs it on the CLR. (Similar to Jython)
  • PyPy (special)
    Python implements Python, and then encodes Python bytecode into machine code.
  • RubyPython, Brython...
Python Environment Install Python Windows:
  • Install Python
  • Configure the python Environment
  • Linux:

    Linux yum dependency comes with Python. To prevent errors, the update here is actually to install another Python

    12345678910111213141516171819 View the default Python versionpython -V  1Install gcc for compiling Python source code    yum install gcc2Download the source code package, https://www.python.org/ftp/python/3, Decompress and enter the source code file4, Compilation and Installation    ./configure    make all    make install5View version    /usr/local/bin/python2.7 -V6Modify the default Python version    mv /usr/bin/python /usr/bin/python2.6    ln -s /usr/local/bin/python2.7 /usr/bin/python7To prevent yum execution exceptions, modify the Python version used by yum    vi /usr/bin/yum    Set the header#! /Usr/bin/python #! /Usr/bin/python2.6

    Related Article

    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.