Python is getting hotter and fiercer day by day. When people consult python, they feel that python is inseparable from artificial intelligence. It is true, but few people know more about python. Wisdom Podcast will tell you what python is.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.
In 1989, a language named Guido van Rossum was designed to pass the time. The first release was published in 1991.
Python is purely free software. The source code and interpreter CPython both follow the GPL (GNU General Public License) agreement.
Python’s syntax is clear and concise, and the most distinctive feature is the use of whitespace as the indentation of statements.
What Is Python
Python has a powerful and rich class library, and it is often called a glue language by others. It can be combined with modules written in other languages (c / c ++). A common situation is to use Python to quickly generate a prototype of a program, and then some of them need to have particularly high requirements and need to be rewritten in other languages. For example, graphics rendering in 3D games need to be written in C / C ++ and then packaged into a .py extension class library to be called by Python. Note that the use of extension types requires cross-platform considerations.
1. Simplicity: Python is a language that represents simplicity.
2. Easy to use: Python is simple and easy to use, because there is simple and easy to understand documentation.
3. Fast: It runs fast, because the standard and third-party libraries in Python are written in C, so it is fast.
4. Free and open source: Python is one of FLOSS (free / source code software), users can freely distribute copies of this software, read its source code, make changes to it, and use part of it for new Free software. FLOSS is based on the concept of sharing knowledge among a group.
5. High-level language: When writing programs in Python, you don’t need to consider low-level details such as how to manage the memory used by your program.
6. Portability: Due to its open source nature, Python has been ported on many platforms (modified 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’s Android platform based on Linux.
7. Interpretability: A program written in a compiled language such as C or C ++ can be converted from a source file (ie C or C ++ language) to a language (binary code, 0 and 1) used by your computer. This process is done by the compiler and different flags and options. When you run the program, the linker / reloader software copies your program from the hard disk to 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 using Python easier. It also makes Python programs more portable.
8. Object-oriented: Python supports both process-oriented programming and object-oriented programming. In a “procedural-oriented” language, a program is built from procedures or functions that are simply reusable code. In “object-oriented” languages, programs are built from objects that combine data and functions.
9. Scalability: 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 use them in Python programs.
10. Embeddability: Python can be embedded in C / C ++ programs to provide scripting capabilities to program users.
11. Rich libraries: The Python standard library is really huge. It can help with a variety of tasks including regular expressions, document generation, unit testing, threads, databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files, password systems, GUI ( Graphical user interface), Tk, and other system-related operations. This is called the “full-featured” concept of Python. In addition to the standard library, there are many other high-quality libraries such as the wxPython, Twisted, and Python image libraries.
12. Standard code: Python uses forced indentation to make the code more readable. Programs written in Python do not need to be compiled into binary code.
1. Single-line statements and command line output problems: Many times you can’t write a program into one line, such as import sys; for i in sys.path: print i. Perl and awk do not have this limitation, and it is more convenient to complete simple programs in the shell. You don’t need to write the program to a .py file like Python.
2. Unique syntax: This may not be called a limitation, but the way it uses indentation to distinguish sentence relationships still confuses many beginners. Even experienced Python programmers can fall into the trap. The most common case is a mix of tabs and spaces that cause errors, which cannot be distinguished with the naked eye.
3. Slow running speed: compared with C and C ++.
System programming: It provides API (Application Programming Interface) to facilitate system maintenance and management. One of the iconic languages under Linux is an ideal programming tool for many system administrators .
Graphics processing: Supported by graphics libraries such as PIL and Tkinter, which can facilitate graphics processing.
Math processing: The NumPy extension provides a number of interfaces to many standard math libraries.
Text processing: The re module provided by Python can support regular expressions, and also provides SGML, 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 through modules that follow the Python DB-API (database application programming interface) specification. Python comes with a Gadfly module, which provides a complete SQL environment. Network programming: Provides a wealth of modules to support sockets programming, which can conveniently and quickly develop distributed applications. Many large-scale software development projects such as Zope, Mnet and BitTorrent. Google use it extensively.
Web programming: Application development language that supports the latest XML technologies.
Multimedia applications: Python’s PyOpenGL module encapsulates the “OpenGL Application Programming Interface” and can perform 2D and 3D image processing. The PyGame module can be used to write game software.
pymo engine: PYMO stands for python memories off. It is an AVG game engine running on Symbian S60V3, Symbian3, S60V5, Symbian3, Android system. It is named PYMO because it is based on the python2.0 platform and is suitable for creating AVG games in the style of memories off.
Hacking programming: Python has a hacking library that has built-in functions you are familiar with or unfamiliar with, but lacks a sense of accomplishment.
Python has a powerful standard library. The core of the Python language includes only common types and functions such as numbers, strings, lists, dictionaries, files, and the Python standard library provides additional functions such as system management, network communication, text processing, database interfaces, graphics systems, and XML processing. . The Python standard library naming interface is clear and well-documented, making it easy to learn and use.
The Python community provides a large number of third-party modules that are used similarly to the standard library. Their functions are all-encompassing, covering many fields of scientific computing, Web development, database interface, and graphics systems, and most of them are mature and stable. Third-party modules can be written in Python or C. SWIG, SIP is often used to convert a library written in C into a Python module. Boost C ++ Libraries contains a set of libraries, Boost.Python, which enables programs written in Python or C ++ to call each other. With a large number of tools based on the standard library, the ability to use low-level languages such as C, and C ++ that can be used as an interface to other libraries, Python has become a powerful glue language that can be applied between other languages and tools.
The main functions of the Python standard library are: text processing, including text formatting, regular expression matching, text difference calculation and merge, Unicode support, binary data, file processing, including file operations, creating temporary files, file compression and archiving, operations Configuration file and other functions, operating system functions, including thread and process support, IO multiplexing, date and time processing, calling system functions, and journaling (logging), network communication, including network sockets, SSL encrypted communication, asynchronous Network communication and other functions Network protocols, support HTTP, FTP, SMTP, POP, IMAP, NNTP, XMLRPC and other network protocols, and provide a framework for writing network servers, W3C format support, including HTML, SGML, XML processing. Other functions, including internationalization support, mathematical operations, HASH, Tkinter, etc.
Subscribe to our newsletter