The Python Tutorial whetting Your Appetite

Source: Internet
Author: User

If you often need a computer to do something, most of these things may be repetitive or tedious, and eventually (eventually) you will want to automate these tasks (automate). For example, you might want to perform some sort of search substitution or renaming in a large text file, and you might want to rearrange (rearrange) in a relatively complex (complicated) way for a bunch (a bunch of) photo file. Or do you prefer to implement a small client database (custom), or a professional (specialized) graphical application, or a simple game.


If you are a professional (professional) software developer, you may be working with multiple C/c++/java libraries, but you will find that the regular (usual)-to-compile-and-test-and-compile reciprocating loops are too slow. Suppose (perhaps) that you have already written a test suite for these libraries, but found that writing these test code is a dull (tedious) task, or maybe you have written a program that can use an extended language, But you don't need to design and implement (implement) a whole new language for your application.


Well, Python is the language you need!


Of course, you can also write a shell script for some tasks under Linux or write a batch file in Windows, but the shell script is primarily useful for working with similar moving files (moving around files) and changes in text data are not very suitable for graphical interface applications and games (not well-suited). Similarly, you can write a C/c++/java program to do the job, but even if you want a beta version of a program it will take a lot of development time (development). So Python is simple and useful in this respect, and Python works on Windows platforms, under Mac platforms, and on Unix-like operating systems, which can help you do your job quickly and easily (get the job done more quickly).


python while it's easy to get started, it's a real programming language, it's relative to shell scripts and batch files, and Python provides more (much) structures (structure) that support large programs at the same time. On the other hand, Python provides more error detection and processing than C, which makes Python a high-level language (Very-high-level language) with advanced data types built into it. For example, flexible (flexible) arrays and dictionaries. Since it contains a large number of common (general) data types, this allows Python to be applied compared to awk,python (applicable) in some large problem areas, and sometimes even compared to Perl, at least relative to other programming languages, Using Python is relatively easy when dealing with a lot of things.


python allows you to divide your program into modules and reuse them in other Python programs, and it is recommended that you do so. Python provides a large collection of standard modules that you can use as a basis for your program, as well as examples of how you can use these modules as a way to learn how to program in Python. These standard modules provide such things as file I/O processing, system calls, socket programming, and even a toolkit (toolkits), such as TK, that can provide a graphical user interface interface.


python is an interpreted language so that it can help you save a lot of (considerable) development time because it does not require (necessary) compile and link. Python's interpreter can also be used in interactive mode (used interactively), which makes it easy to try (experiment) The language features of Python (features of the language), Either write a program that can be discarded at any time (throw-away), or you can use it to test some methods when you are using bottom-up (bottom-up) program development patterns. Ha, again, this is also your handy (handy) Desktop Calculator (calculator).


python It is hoped that the program can be written in a concise (compactly) and easy-to-read (readably) manner. The program written in Python, compared to other programs such as C, C + +, Java and so on to write a lot of short, mainly for the following reasons:

1 , built-in advanced data types allow you to use a simple declaration (statement) when you want to express some complex (complex) actions instead

2 , using indentation (indentation) to declare code snippets or groups instead of regular start, end square brackets (brackets)

3 , variables and parameters must be declared before use (declarations) is no longer necessary


python is extensible. If you know how to write a C program, it can be very easy to add a built-in method or module to the Python interpreter, or to perform (perform) some critical operations (critical operations) with the fastest speed (maximum) , or link python programs in the library, this is only possible in binary format (for example, a graphics rendering library like OS platform vendor-specific (Vendor-specific)). Once your real link is successful, then you can link the Python interpreter in your C program's application and then treat it as an extension or a command-line programming language.


By the way, the source of Python naming, Python is named Python because of a program broadcast by the BBC Monty Python's Flying Circus (Monty Python's flaying Circus (Circus)), And not with any reptile (reptiles). Monty Python (skits) as a reference in the documentation (Making Reference) is not only allowed, but is encouraged (encouraged) to do so!


Now that you're excited about Python (excited), you want to try it out (examine) for more details about Python (detail). The best way to learn a language is to use it, and the introductory guide in the manual is an invitation to play with the Python interpreter on the command line and start your learning journey!


In the next section, you will be explaining (explained) How to use the Python interpreter on your machine. This is also a relatively simple (rather) document information, but at the end of the document you will be provided with some highlights (essential) cases for you to practice.


This chapter of the guide to Getting Started in the manual introduces a number of case studies (introduces) on the various (various) features of the Python language and system, from simple expressions (expressions), statement blocks (statements), and data types, Then to the methods and modules, and finally can come into contact with (touching upon) advanced features (concepts) like exceptions and custom classes.


The Python Tutorial whetting Your appetite

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.