Open-source Python Programming

Source: Internet
Author: User
Tags coding standards
For more information about open-source Python programming-general Linux technology-Linux programming and kernel, see the following. I first tried to use this scripting language to customize Mailman in Python, a mail list management software package. At first, I was bored with Python's strict syntax rules and space formatting. However, after a long time, many codes are written. the syntax of the original Python script is actually simple and easy to understand. Python is a powerful tool. Every open-source programmer should be familiar with and master it.

   What is Python?

Python is an open-source scripting language that emphasizes development speed and code clarity. It can be used to develop various programs, from simple script tasks to complex and object-oriented applications. Python is also considered as a good language for beginners, because it is free, object-oriented, and highly scalable while implementing strict coding standards.

   Python is free of charge

Guido van rosum began developing Python in 1990. Its initial goal was nothing more than a self-entertainment project. As a fan of Monty Python's flying circus program, he gave his own programming language the odd name of the present, which is the Chinese meaning of Python. Python was originally designed as a scripting language to replace the Amoeba distributed operating system ABC, but soon this new programming language quickly developed into a weapon that can solve a considerable number of problems and is now introduced to a variety of platforms.

Guido is also the chairman of the Python Software Foundation. The organization owns the intellectual property and permission of Python as required by the GNU Public License Agreement. Python can be used on a variety of platforms, including Windows, Macintosh and a variety of common UNIX systems. In addition, the corresponding versions of the Pocket PC for PalmOS and Microsoft are also under development.

   Superior Python Quality

Although Python is often used to create simple scripts, the programming technology it uses is not simple, such as object-oriented coding, sockets, threads and guis. If you are a new programmer, these features are obviously very helpful to you, because you can quickly get familiar with useful programming syntax and coding practices, and then learn other languages, for example, Java or C ++ introduces more technical concepts. The script can be executed independently. However, you can also use class files and various object types to make full use of the powerful functions of this language.

There are two key differences between Python and other object-oriented languages. First, Python emphasizes space and encoding structure, so that developers' code can be reused. Second, Python code does not need to be compiled before the script is executed, which is why it is used as a script language.

   Python is easy to expand

The Python language has a striking advantage in that it can call function libraries for functions that cannot be completed by the language. Python also has some useful tools to help develop complex applications. The most common tool is Tkinker, which enables cross-platform GUI development. Another wxPython tool is an extension of the wxWindows cross-platform C ++ framework. WxPython currently supports Windows and Linux platforms. Python Imaging libraryallows pythonto create a notebook to edit and modify the notebook, such as. gifini.htm and. PNG. To learn about common Python extensions and applications, visit The Vaults of Parnassus.

Python itself can also be embedded into other programming languages. The most common is [url = http://www.jython.org/mongojythonmongourl.pdf, which is a pythoninterpreter compiled by Java. In this way, you can use the advantages of both languages. You can also create applications that depend on the two language libraries by combining the clear Python syntax in the powerful Java application framework.

   Encoding standard

Strict Python syntax is the main reason why Junior programmers ignore this powerful programming language. Unlike most other Web scripting languages, the blank layout of Python does not rely on parentheses or semicolons to indicate the end of a statement. line breaks and Placeholders are used to describe the visual results of the Code. At first glance, this programming method is boring, but it is of great benefit to you. This is the reliability of the Code. Python is structured based on the following theory: the most valuable asset of the developer's work time institution property. Once you get used to writing Python code rules. In fact, you get used to a built-in encoding standard. This is also the standard that most Python developers rely on.

   Obtain Python

You can get Python versions from http://www.python.org or on various platforms. The ActiveState website also released Python libraries for Windows, Linux, Solaris, and other platforms.

   Simplest Python code

The following is an example of Python. Suppose you are currently using a Windows system and have installed Python, first start IDLE, that is, the Python GUI. It is now in Python Shell (if you are on a UNIX system, you need to type the python type to indicate your Python executable files ). At the ">>>" prompt, type: >>> print "Hello World"

This familiar program displays results on the screen. You can assign values to variables as follows:
>>> Myvar = 42
>>> Print myvar

In the preceding example, result 42 is displayed.

It is more useful if you do not need to input Python directly in the Python Shell. Program list A contains an example of A Hello World script, where the if-else statement is compiled.

You can type scriptname. py on the command line to execute your own script (py is the standard file extension of the Python script ). You should be able to see the correct display results. In listing A, the statements that are scaled down by placeholders after if and else are part of the blank formatting.

These simple examples demonstrate the clear syntax of Python. For more information about Python programming, see the beginner's guide on the Python website. If you are not used to surfing the Internet, you can also read related books published by o'reilly and New Riders. For example, How to Think Like a Computer Scientist: Learning with Python and Python Essential Reference.

   Summary

Whether you are an entry-level programmer who is new to programming languages to increase your knowledge and skills, or a Perl expert who wants to increase code reliability, you will find that Python is a flexible and powerful programming language. It can develop a variety of applications, from a full range of functional mailing list software to a variety of cross-platform GUI applications.
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.