A brief introduction to Python programming language features.

Source: Internet
Author: User

If you did much work on computers, eventually your find this there ' s some task you ' d like to automate. For example, if wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bun Ch of photo files in a complicated way. Perhaps you ' d like to write a small custom database, or a specialized GUI application, or a simple game.

If you are a professional software developer, you could have to work with several C/c++/java libraries but find the usual WRI Te/compile/test/re-compile cycle is too slow. Perhaps ' re writing a test suite for such a library and find writing the testing code a tedious task. Or Maybe you ' ve written a the could use a extension language, and you don ' t want to design and implement a whole New language for your application.

The Python is just the language for you.

You could write a Unix shell script or Windows batch files for some of the tasks, but shell scripts are best at movi Ng around files and changing text data, not well-suited for GUI applications or games. You are could write a C/c++/java program, but it can take a lot of development a even. Python is simpler to use, available on Windows, Mac OS X, and Unix operating systems, and'll help you with the job done M Ore quickly.

Python's simple to-use, but it's a real programming language, offering too much structure and support for large s than shell scripts or batch files can offer. On the other hand, Python also offers much more error checking than C, and, being a very-high-level language, it has high- Level data types built in, such as flexible arrays and dictionaries. Because of more general data types Python are applicable to a much larger problem domain than AWK or even Perl, yet Mans Y things are at least as easy in Python as in those languages.

Python allows you-to-split your program into modules, can is reused in the other Python programs. It comes with a large collection of standard modules and can use as the basis of your programs-or as examples to St Art Learning to program in Python. Some of modules provide things like file I/O, System calls, sockets, and even interfaces to graphical user interface Toolkits like Tk.

Python is a interpreted language, which can save you considerable time during program development because no Compilat Ion and linking is necessary. The interpreter can is used interactively, which makes it easy to experiment with features of the language, to write throw -away programs, or to test functions during bottom-up. It is also a handy desk calculator.

Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, C + +, or Java Programs, for several reasons:the h Igh-level data types allow you to express complex operations, a single statement; Statement grouping is do by indentation instead of beginning and ending brackets; No variable or argument declarations are necessary.

Python is extensible:if your know to program in C it's easy to add a new built-in function or module to the interpret Er, either to perform critical operations in maximum speed, or to link Python programs to libraries Able in binary form (such as a vendor-specific graphics library). Once you are really hooked, your can link the Python interpreter into a application written in C and use it as a Extensio N or command language for that application.

By the way, the language are named after the BBC show "Monty Python's Flying Circus" and has nothing to does with reptiles. Making references to Monty Python skits in documentation isn't only allowed, it is encouraged!

Now so you are all excited about Python and you'll want to examine it in some more detail. Since the best way to learn a languagebe to use it, the tutorial invites for you and the Python interpreter As you read.

In the next chapter, the mechanics of using the interpreter are explained. This is rather mundane information, but essential to trying out the examples shown.

The rest of the tutorial introduces various features of the Python language and system through examples, beginning with Si Mple expressions, statements and data types, through functions and modules, and finally touching upon advanced concepts Li KE exceptions and user-defined classes.

The above content is reproduced in the Python forum. If there is infringement, please tell me to delete.

Today, I'm officially studying Python. Perseverance is victory.

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.