The path to a Python guru [1] first understanding of python, first understanding of the path to python

Source: Internet
Author: User

The path to a Python guru [1] first understanding of python, first understanding of the path to python

Python Introduction

 

1: Founder of Python

Python /), it is an advanced programming language for interpreting, object-oriented, and dynamic data types. It was invented by Guido van rosum in 1989 and released in 1991 as the first public release.

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.

The Python community gave him the title of "benevolent Lord" directly from the British soap opera Monty Python flying circus. Guido chose Python as the language name because he liked this soap opera too much.

 

2: Python status quo

Programming Language ranking: http://www.tiobe.com/tiobe_index

3: Advantages of Python

Simple: Python is a language that represents the simple ideology. Reading a good Python program is like reading English. It enables you to focus on solving problems rather than understanding the language itself.

Easy to learn: Python is extremely easy to use, because Python has extremely simple instructions.

Fast: Python is written in C language at the underlying layer. Many standard and third-party libraries are also written in C and run very fast.

Free and Open Source: Python is one of FLOSS (Free/open source software. Users can freely publish copies of the software, read its source code, make changes to it, and use part of it in new free software. FLOSS is based on the concept of a group sharing knowledge.
High-level Language: when writing a program in Python, you do not need to consider the underlying details such as how to manage the memory used by your program.

Portability: because of its open source nature, Python has been transplanted on many platforms (changed to enable it to work on different platforms ). These platforms include Linux, Windows, FreeBSD, Macintosh, Solaris, OS/2, Amiga, AROS, AS/400, BeOS, OS/390, z/OS, Palm OS, QNX, VMS, Psion, Acom risc OS, VxWorks, PlayStation, Sharp Zaurus, Windows CE, PocketPC, Symbian, and Google android platform developed based on linux.

Description: a program written in a compiled language such as C or C ++ can be written from the source file (C or C ++) convert to a language used by your computer (binary code, namely, 0 and 1 ). This process is completed by the compiler and different tags and options.

When running the program, the connection/reprinter software copies your program from the hard disk to the memory and runs it. Programs Written in Python do not need to be compiled into binary code. You can run the program directly from the source code.

Inside the computer, the Python interpreter converts the source code into an intermediate form called bytecode, and then translates it into the machine language used by the computer and runs it. This makes Python easier. It also makes Python programs easier to transplant.

Object-oriented: Python supports both process-oriented and object-oriented programming. In a "process-oriented" language, a program is built by a process or a function that is only reusable code. In the "Object-Oriented" language, a program is built by combining data and functions.

Scalability: If you need a piece of key code to run faster or want some algorithms not to be made public, you can write some programs in C or C ++ and then use them in Python programs.

Embedding: You can embed Python into C/C ++ programs to provide script functions to program users.

Rich libraries: the Python standard library is indeed huge. It can help with various tasks, including regular expressions, document generation, unit testing, threads, databases, web browsers, CGI, FTP, e-mail, XML, XML-RPC, HTML, WAV Files, password systems, GUI (graphical User Interface), Tk, and other system-related operations. This is called Python's "full functionality" concept. In addition to the standard library, there are many other high-quality libraries, such as wxPython, Twisted, and Python image libraries.

Standard Code: Python uses forced indentation to make the code readable. Programs Written in Python do not need to be compiled into binary code.

4: disadvantages of Python

Single-line statements and command line output problems: in many cases, you cannot write a program into a single line, such as import sys; for I in sys. path: print I. Perl and awk do not have this restriction, so it is easier to complete simple programs in shell. Like Python, programs must be written into a. py file.

Unique Syntax: this may not be called a limitation, but it uses indentation to differentiate the relationship between statements, which is still confusing for many beginners. Even experienced Python programmers may fall into a trap. The most common case is that the combination of tabs and spaces will lead to errors, which cannot be separated by the naked eye.

Slow running: Compared with C and C ++.

5: Python Application system Programming: provides an API (Application Programming Interface) to facilitate system maintenance and management. One of the iconic languages in Linux, it is an ideal programming tool for many system administrators [7]. Graph processing: supports PIL, Tkinter, and other graphics libraries to facilitate graph processing. Mathematical processing: The NumPy extension provides a large number of interfaces with many standard mathematical libraries. Text processing: The re module provided by python supports regular expressions and the SGML and XML analysis modules. Many programmers use python to develop XML programs. Database Programming: programmers can communicate with Microsoft SQL Server, Oracle, Sybase, DB2, MySQL, SQLite and other databases by following the Python DB-API (Database Application Programming Interface) specification module. Python comes with a Gadfly module that provides a complete SQL environment. Network Programming: provides a wide range of modules to support sockets programming, allowing you to easily and quickly develop distributed applications. Many large-scale software development plans, such as Zope, Mnet, and BitTorrent. Google, are widely used. Web programming: The application development language that supports the latest XML technology. Multimedia Applications: Python's PyOpenGL module encapsulates "OpenGL application programming interfaces" for 2D and 3D image processing. The PyGame module can be used to compile game software. Pymo engine: called python memories off, PYMO is an AVG game engine running on Symbian S60V3, Symbian3, S60V5, Symbian3, and Android systems. It is developed based on the python2.0 platform and is suitable for creating AVG games in the memories off style. Therefore, it is named PYMO. Hacker programming: python has an hack library with built-in functions that you are familiar with or are not familiar with, but lacks a sense of accomplishment. Use Python to write simple Crawlers
Python Installation
1: compared with the previous version, install python in windows 3.5 and select the add python to Path option (for example ). Installation of Python2.7:

1. Download the installation package https://www.python.org/downloads/
2. default installation path: C: \ python27
3. Configure Environment Variables
Right-click the computer and choose Properties> advanced system Settings> advanced environment variables> Path in the second content box. one row, double-click] --> [append the Python installation directory to the variable value and use; Separate]
For example: the original value; C: \ python27; remember that there is a semicolon before

2: Installation in Linux

Python 2.7 is provided in Linux but must be upgraded to Python! View the default Python version

[root@centos ~]# python -V

1. Install gcc for compiling Python source code

yum install gcc

2, download the source package, https://www.python.org/ftp/python/

3. decompress and enter the source code file.
4. Compile and install

./configuremake allmake install

5. view the version

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


6. Modify the default Python version.

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

 

7. Prevent yum execution exceptions and modify the Python version used by yum.

Vi/usr/bin/yum: add the header #! /Usr/bin/python #! /Usr/bin/python2.6
 

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.