Introduction to Python Basics Tutorial

Source: Internet
Author: User
Tags image processing library

About Python


About Python

Python is an interpreted, object-oriented, dynamic data type of high-level programming language, belonging to the application-level software. Since the the early 1990s Python language was born, it has been widely used in the field of processing system management tasks, automation operations, image processing games and Web site development. Python has become one of the most popular programming languages. 4, easy to read and extensible, in the foreign use of Python scientific computing research institutions are increasing, some well-known universities have adopted the Python teaching program design courses. For example, MIT's introductory Course in computer science and programming is taught in the Python language. Many open source scientific computing packages provide Python's calling interface, such as the famous Computer Vision Library OpenCV, the three-dimensional visual library VTK, and the medical image processing library ITK. Python's dedicated Scientific computing expansion library is more, such as the following 3 very classical scientific extension libraries: NumPy, SciPy, and matplotlib, which provide Python with fast array processing, numerical operations, and drawing capabilities, respectively. As a result, the Python language and its many expansion libraries make up the development environment ideal for engineering, scientific researchers working with experimental data, charting, and even developing scientific computing applications.

The Python developer's philosophy is "in one way, it's best to have only one way to do something."

History of Python

The founder of Python is Guido van Rossum. During the Christmas of 1989, in Amsterdam, Guido was determined to develop a new script interpreter as an inheritance of the ABC language in order to get rid of the boredom of Christmas. Python was chosen as the name of the program because he was a fan of the Monty Python Flying Circus.

ABC is a language of instruction designed by Guido. As far as Guido himself is concerned, the language of ABC is very graceful and powerful and is designed specifically for non-professional programmers. But the ABC language did not succeed, the reason, Guido think is caused by its non-open use principle. Guido is determined to avoid this error in Python (indeed, Python is very good with other languages such as C, C + +, and Java). At the same time, he wanted to achieve something that had flashed in ABC but had never been realized.

In this way, Python was born in the hands of Guido. In fact, Python is first implemented on Mac machines. It can be said that Python evolved from ABC and was largely influenced by the Modula-3 (another rather beautiful and powerful language designed for small groups). and a combination of Unix shell and C habits. Become a development language favored by many UNIX and Linux developers. 5

Python language Features

Extensibility can be said to be a major feature of Python as a programming language. The expanded new module (modules) can be written in C or C + +. We can also add Python interfaces to ready-made modules. Python allows the user to avoid excessive grammatical fetters and concentrate on the program tasks (logic) to be implemented.

Python is also known as a clear language. Because its author is designing it, the general guideline is that for a particular problem, as long as there is a best way to solve the good.

Another meaning of the Python language is a clear language that its authors intentionally design restrictive grammars that make bad programming habits (such as the next line of an if statement not indented to the right) fail to compile. This intentionally forces the programmer to develop good programming habits. One of the most important is the Python indentation rules.

Python foreground

Python's share in programming has been steadily rising, with the latest data, Python ranked seventh. The top six are java,c,vb,c++,php and Perl respectively. With Microsoft incorporating Python into the. Net platform, it is believed that Python will grow more strongly in the future. Python is likely to become. NET platform for rapid development of the mainstream language. For more information on this, please refer to iron python.

Google, the famous search engine, also uses Python heavily. Even more surprisingly, Python can also run on the Android phone operating system on the Symbian operating system used by Nokia smartphones, with many Python enthusiasts learning the Python language from the Android platform. There is no reason not to believe that Python will become the third programming language after C++,java! It is visible that Python has a huge influence.

The language status of Python

Python is generally considered to be an explanatory language, but this is not true, and in fact Pyt hon, when executed, will first compile the source code in the. py file into Python's byte code (bytecode) and then the Python Virtual Machine to execute these compiled byte code. The basic idea of this mechanism is with Java,. NET is consistent. However, Python virtual machine differs from Java or. NET virtual machine in that Python's virtual machine is a more advanced virtual machine. The high-level here is not in the usual sense, not that Python's virtual machine is more powerful than Java or. NET, but rather that Python's virtual machines are farther away from the real thing than Java or. Net. Or so, Python's virtual machine is a higher-level, more abstract virtual machine.

Application areas of Python

Python is not just a well-designed programming language, it can accomplish a variety of tasks in the real world, including what developers do day after day. As a tool for compiling other components and implementing standalone programs, it is often used in a variety of fields. In fact, as a common language, Python's application role is almost limitless: you can apply Python on any occasion, from website and game development to robotics and Space shuttle control.

However, Python's application areas fall into the following categories. The following are some of the most common application areas for Python today, as well as some of the tools used in each application area. We don't delve into the tools, and if you're interested in these topics, get more information from the Python website or some other resources. 6

System programming

Python's built-in interface to operating system services makes it an ideal tool for writing portable management tools and parts (sometimes called shell tools) that maintain the operating system. Python programs can search for files and directory trees, run other programs, process or thread in parallel, and so on.

Python's standard library binds POSIX and other general operating system (OS) Tools: Environment variables, files, sockets, pipelines, processes, multithreading, regular expression pattern matching, command-line arguments, standard stream interfaces, Shell command initiators, file name extensions, and so on. In addition, many Python system tools are designed with portability in mind. For example, a script that replicates a directory tree can run on almost any Python platform without any modification.

User Graphics interface

Python's simplicity and fast development cycles are ideal for developing GUI programs. Python has built-in Tkinter's standard object-oriented interface tk GUI API, enabling Python programs to generate portable, native-looking GUI applications. The Python/tkinter GUI can be run on platforms such as Microsoft Windows, X Windows (UNIX and Linux), and Mac OS (Classic and OS X support) without any changes. A free expansion pack, PMW, adds some advanced components to the Tkinter toolkit. In addition, the toolkit Wxpython GUI API based on the C + + platform can build portable GUI applications using Python.

Some advanced toolkits, such as Pythoncard and Dabo, are built on top of Wxpython and Tkinter's underlying APIs. For applications running in the browser, Jython (the Java version of Python, which we'll cover in the 2nd chapter) and the Python server-side CGI script provide some other user interface choices.

Database programming

For traditional database requirements, Python provides interfaces to all major relational database systems, such as Sybase, Oracle, Informix, ODBC, MySQL, PostgreSQL, The common database Python such as SQLite has the corresponding interface function library to access these databases. Python defines a portable database API interface function that accesses the SQL database system through a Python script, which is unified for the database systems of various underlying applications. For example, because the vendor's interface is implemented as a portable API, a free software MySQL database Access application script can work on other database systems (for example, Oracle) to a large extent without change, and can only be achieved by replacing the underlying vendor interface.

Numerical computation and scientific computational programming

The Python extension package NumPy We mentioned earlier includes many advanced tools, such as matrix objects, interfaces to standard math libraries, and so on. Using NumPy to turn Python into a rigorous and easy-to-use numerical computing tool, other numerical tools provide Python with support for animations, 3D visualizations, parallel processing, and more.

Games, images, artificial intelligence, etc.

Python can use the Pygame system for image graphics processing and game programming, image processing with PIL and other tools, robot control programming with the Pyro Toolkit, XML parsing with XML libraries, xmlrpclib modules, and other third-party extensions ; Use the neural network emulator and the professional system shell for AI programming; Use the NLTK package for natural language analysis: You can even play chess with the Pysol program. You can find more support in these areas from vaults of Parnassus and the new PyPI website (please get specific links on Google or http://www.python.org).

Component integration

When describing Python as a control language, it has involved the role of component integration. Python can be extended through a C + + system and can nest the features of A/C + + system so that it can be scripted to handle the behavior of other systems and components as a flexible glue language. For example, integrating a C library into Python allows you to test with Python and invoke other components in the library, embed Python into the product, and be able to customize the product individually without recompiling the entire product or the source code.

For use in scripts, code generation tools such as SWIG and sip allow this part of the work to be done automatically when a Python connection compiles components. Larger frameworks, such as the COM supported by Microsoft Windows for Python, the Java implementation-based Jython, the. NET-based IronPython and various CORBA toolkits, provide a variety of different scripting components. For example, in Windows, a Python script can use the framework to script Microsoft Word and Excel files.

Internet scripts

Python provides standard Internet modules that enable Python to function extensively across a wide range of network tasks, both on the server and on the client side. Scripts can communicate through sockets, parse information from a form that is sent to a server-side CGI script, fetch a Web page from a URL, parse HTML and XML files from a retrieved Web page, and communicate through XML-RPC, SOAP, and Telnet. The Python library makes it all quite simple.


This article is from the "Python Training Zhipu Education" blog, so be sure to keep this source http://jeapedu.blog.51cto.com/7878264/1616997

Introduction to Python Basics Tutorial

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.