Python path Day1-Python basics 1, pythonday1-python
I. Introduction to Python (English pronunciation:/pa ɪ θ n/American pronunciation:/ˈ pa ɪ θ ɑ n /), it is an object-oriented interpreted computer programming language. It was invented in 1989 by Guido van rosum, a Dutch user. The first public release was released in 1991. Python is purely free software. The source code and interpreter CPython follow the GPL (GNU General Public License) protocol. The Python syntax is concise and clear. One of its characteristics is to force the white space to be used as the statement indent. Python has rich and powerful libraries. It is often called the glue language, and can easily connect various modules (especially C/C ++) made in other languages. A common application scenario is to use Python to quickly generate a prototype of a program (sometimes even the final interface of the Program) and then have a special requirement on it, rewrite with a more appropriate language. For example, if the graphic rendering module in 3D games has high performance requirements, you can rewrite it with C/C ++ and encapsulate it as an extension class library that can be called by Python. Note that you may need to consider Platform issues when using the extended class library, and some may not provide cross-platform implementation. In July 20, IEEE published the ranking of programming languages in 2017: Python ranked first. Application field: 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. 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. Features:
Advantages
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 [7]. 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. [5] 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.
Disadvantages
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 ++.