Python key points Common sense

Source: Internet
Author: User
Tags lua

Key points of common sense
  • The pronunciation and spelling of Python
  • The author of Python is Guido van Rossum (Uncle Tortoise)
  • Python was formally born in 1991
  • Python's interpreter is now available in several languages, and we often use CPython (the official version of the C language implementation), as well as Jython (which can run on the Java platform), IronPython (which can run on the. NET and mono platforms), PyPy (Python-enabled, JIT-on-the-fly compilation)
  • Python currently has two versions, Python2 and Python3, and the latest version is 2.7.13 and 3.6.2
  • Life are shot, you need Python. Life is short, I use Python. Iv. advantages and disadvantages of Python
    • Simple: Python is a language that represents the idea of simplicity. Reading a good Python program feels like reading English, even though the requirements of this English are very strict! This pseudo-code nature of Python is one of its greatest advantages. It allows you to focus on solving problems rather than figuring out the language itself.

    • Easy to learn: As you will see, Python is extremely easy to get started with. As mentioned earlier, Python has a very simple syntax.

    • Free, open Source: Python is one of floss (free/open source software). Simply put, you are free to publish a copy 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. That's one of the reasons why Python is so good-it's created and constantly improved by a group of people who want to see a better python.

    • High-level languages: When you write 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). If you are careful to avoid using system-dependent features, all your Python programs can run without modification on any of the platforms listed below. 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 and even PocketPC, Symbian, and Google Linux-based Android platforms!

    • Interpreted language: 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 your 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. In fact, because you no longer need to worry about how to compile the program, how to make sure that the connection is reprinted with the correct library, and so on, all this makes using Python easier. Since you only need to copy your Python program to another computer, it will work, which makes your Python program 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. Python implements object-oriented programming in a very powerful and simple way, compared to other major languages such as C + + and Java.

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

    • Rich Library: The Python standard library is really huge. It can help you 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. Remember that all of these features are available as long as Python is installed. 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 extremely readable.

    Disadvantages

    Python language is very perfect, there is no obvious short board and shortcomings, the only drawback is that the implementation of slow, this is the interpretation of the language, and this shortcoming will be the computer more and more powerful performance to compensate.

    V. Python application Scenarios
    • Web application Development

      Python is often used for web development. For example, with the Mod_wsgi module, Apache can run web programs written in Python. Python defines the WSGI standard application interface to coordinate the communication between the HTTP server and the Python-based Web program. Some web frameworks, such as django,turbogears,web2py,zope, can make it easy for programmers to develop and manage complex web programs.

    • Operating System Management, server operations Automation scripts

      In many operating systems, Python is the standard system component. Most Linux distributions, as well as NetBSD, OpenBSD, and Mac OS X, are integrated with Python and can be run directly under the terminal. Some installers for Linux distributions are written in the Python language, such as the Ubuntu ubiquity Installer, Red Hat Linux, and Fedora's Anaconda installer. Gentoo Linux uses Python to write its Portage package management system. The Python standard library contains multiple libraries that invoke operating system functionality. By Pywin32 This third-party package, Python has access to Windows COM services and other Windows APIs. Use the Ironpython,python program to directly invoke the. Net Framework. In general, the system management scripts written by Python are superior to normal shell scripts in terms of readability, performance, code reuse, and extensibility.

    • Web crawler

      Python has a large number of HTTP request processing libraries and HTML parsing libraries, and has a mature and efficient crawler framework scrapy and distributed Solutions Scrapy-redis, the application of crawler is very extensive.

    • Scientific calculations

      NumPy, SciPy, Pandas, matplotlib allow Python programmers to write scientific computing programs.

    • Desktop software

      PyQt, Pyside, WxPython, and PYGTK are a powerful tool for Python to rapidly develop desktop applications.

    • Server Software (network software)

      Python's support for various network protocols is perfect, so it is often used to write server software and web crawlers. The third-party library twisted supports asynchronous network programming and most standard network protocols (including clients and servers), and provides a variety of tools that are widely used to write high-performance server software.

    • Game

      Many games use C + + to write high-performance modules such as graphical display, while using Python or Lua to write game logic, servers. Compared to Python,lua, the functionality is simpler and smaller, while Python supports more features and data types.

    • Concept implementation, early prototyping and iteration of the product

      Google, NASA, and Facebook are using Python extensively in their own way.

Python key points Common sense

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.