Python Master Road "one" first knowledge of Python

Source: Internet
Author: User
Tags soap

About Python

founder of 1:python

Python (United Kingdom pronunciation:/?pa?θ?n/American pronunciation:/?pa?θɑ?n/), is an interpreted, object-oriented, dynamic data type of high-level programming language, by the Dutch Guido van Rossum invented in 1989, the first public release version was released in 1991.

The founder of Python is Guido van Rossum (Guido van Rossum). During the Christmas of 1989, Guido van Rossum to spend time in Amsterdam, determined to develop a new script interpreter, as an inheritance of the ABC language.

The Python community has given him the title of "Benevolent King", a title that comes directly from the British soap opera Monty Python Flying Circus. Guido chose Python as the name of the language because he liked the soap opera so much.

the status quo of 2:python

Ranking of programming languages: Http://www.tiobe.com/tiobe_index

Advantages of 3:python

Simple: Python is a language that represents the idea of simplicity. Reading a good Python program feels like reading English. It allows you to focus on solving problems rather than figuring out the language itself.

Easy to learn: Python is extremely easy to get started because Python has extremely simple documentation.

Fast: The bottom of Python is written in C, and many standard libraries and third-party libraries are written in C and run very fast.

Free, open Source: Python is one of floss (free/open source software). The user is free to publish copies of the software, read its source code, make changes to it, and use it as part of the new free software. Floss is the concept of sharing knowledge based on a group.
High-level languages: When writing programs in the Python language, you don't have 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 ported on many platforms (modified to make it 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 Linux-based Android platforms.

Explanatory: A program written in a compiled language, such as C or C + +, can be converted from a source file (that is, C or C + +) to a language used by your computer (binary code, 0 and 1). This process is done through the compiler and different tags and options.

When you run the program, the connection/reprint software copies your program from the hard disk into memory and runs. Programs written in the Python language 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 translates 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 it easier to use Python. It also makes Python programs easier to migrate.

Object-oriented: Python supports both process-oriented programming and object-oriented programming. In a "process-oriented" language, a program is built from a procedure or simply a function of reusable code. In "Object-oriented" languages, programs are built from objects that combine data and functionality.

Extensibility: If you need a piece of critical code to run faster or you want some algorithms to be private, you can write some programs in C or C + + and then use them in a Python program.

Embeddable: Python can be embedded in a C + + program to provide scripting functionality to program users.

Rich Library: The Python standard library is really huge. It can help with all kinds of work, including regular expressions, document generation, unit tests, threads, databases, Web browsers, CGI, FTP, e-mail, XML, XML-RPC, HTML, WAV files, cryptography systems, GUI (graphical user interface), TK, and other system-related operations. This is called Python's "fully functional" concept. In addition to the standard library, there are many other high-quality libraries, such as Wxpython, twisted, and Python image libraries, and so on.

Canonical code: Python uses forced indentation to make the code more readable. Programs written in the Python language do not need to be compiled into binary code.

Disadvantages of 4:python

Single-line statements and command-line output problems: Many times you cannot write a program to a line, such as import sys;for I in Sys.path:print i. Perl and awk do not have this limitation, it is easier to complete a simple program under the shell, do not need to like Python, the program must be written to a. py file.

Unique syntax: This may not be referred to as limitation, but it is also confusing for many beginners by indenting the way in which the statement relationship is differentiated. Even the most experienced Python programmers can get caught up in a trap. The most common scenario is that the mix of tabs and spaces can cause errors, which cannot be separated by the naked eye.

Slow running: This is compared to C and C + +.

Application of 5:pythonSystem Programming: Provides API (Application programming Interface application programming Interface), can facilitate system maintenance and management, Linux under one of the iconic languages, is the ideal programming tool for many system administrators [7]. graphics Processing: PIL, Tkinter and other graphics library support, can be easily graphics processing. Mathematical Processing: The numpy extension provides a large number of interfaces to many standard math libraries. Text Processing: The re module provided by Python supports regular expressions, and it also provides sgml,xml analysis modules, and many programmers use Python for the development of XML programs. Database Programming: Programmers can communicate with Microsoft SQL Server,oracle,sybase,db2,mysql, SQLite, and other databases through modules that follow the Python DB-API (database application programming Interface) specification. Python comes with a gadfly module that provides a complete SQL environment. Network Programming: Provides a wide range of modules to support sockets programming, enabling fast and easy development of distributed applications. Many large-scale software development programs such as Zope,mnet and BitTorrent. It is widely used by Google. Web Programming: The development language of the application, supporting the latest XML technology. multimedia applications: Python's Pyopengl module encapsulates the "OpenGL application Programming Interface" for two-and three-dimensional image processing. The Pygame module can be used to write game software. Pymo Engine: Pymo, all called Python memories Off, is a AVG game engine running on Symbian S60v3,symbian3,s60v5, SYMBIAN3, and Android systems. It is named Pymo because it is developed based on the python2.0 platform and is applicable to the AVG game that creates the memory of autumn (memories off) style. hacking Programming: Python has a hack library with built-in functions that you are familiar with or unfamiliar with, but lack a sense of accomplishment. write a simple crawler in Python
Installation of Python
installation under the 1:windowscompared to the previous version 3.5 is selected directly during installation: the first step of the Add Python to Path option is available (for example). installation of Python2.7:

1. Download the installation package https://www.python.org/downloads/
2. Install the default installation path: C:\python27
3. Configure Environment variables
"Right-click Computer"-"Properties"-"Advanced system Settings"-"Advanced"-"Environment variable"-"in the second content box to find the variable named path of a row, double-click"-"Python installation directory appended to the variable value, with;
such as: the original value; C:\python27, remember that there's a semicolon in front

installation under the 2:linux

Linux comes with the python2.6 version, but needs to be upgraded to version 2.7! View the default Python version

[[Email protected] ~] # 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. Unzip and enter the source file
4. Compile and install

./configuremake allmake Install

5. View version

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


6. Modify the default Python version

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

7. To prevent Yum from performing exceptions, modify the Python version used by Yum

vi/usr/bin/#!/usr/bin/python modified to #!/usr/bin/python2.6

Python Master Road "one" first knowledge of Python

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.