Getting Started with Python

Source: Internet
Author: User
The first chapter introduces
The scripting language is a language similar to DOS batches and UNIX shell programs. The scripting language does not need to be compiled and executed every time, and it is easy to access running programs in execution, and can even dynamically modify running programs for fast development and simple tasks. There are often new features that need to be added when scripting languages are used, but sometimes because the scripting language is inherently slow, large, and complex, or the required functionality involves a system call or other function that can be provided only in C, which is usually not important to the extent that the C language must be rewritten; Solving the problem requires data types such as variable-length strings (such as an ordered list of file names) that are easy to use in scripting languages, and that C requires a lot of work to do, or that programmers are unfamiliar with the C language: In these cases, scripting languages are available.

In this case, Python may be just right for your needs. Python is simple to use, but it is a real programming language and provides more structure and support for large programs than the shell. On the other hand, it provides more error checking than C, which is a very high-level language with built-in high-level data structures such as flexible arrays and dictionaries that can take you a few days to implement efficiently with C. Because Python has a more general data structure, it has a wide range of applications than awk or even Perl, and many things are as easy within Python as it is within those languages.

 

Python allows you to break down your programs into modules that can be reused in other Python programs. It comes with a large number of standard modules that can be used as the basis for your own programs-or as an example of learning Python programming. The system also provides information about file input and output, system calls, sockets (sockets), and even provides a common interface to the window System (Stdwin).

 

Python is an explanatory language that saves a lot of program development time because it does not need to be compiled and connected. The interpreter can be used interactively, so that it is easy to experiment with the various features of a language, write a program that is used only once, or test a function in the development of a bottom-up program. It's also a handy calculator.

 

Python allows you to write very rigorous and readable programs. Programs written in Python are usually shorter than the corresponding C program because of the following reasons:

 
Advanced data structures allow you to express complex operations with a single statement;
The compound statement is indented and then not used to denote the opening and closing of parentheses;
No variable declaration or parameter declaration is required.
Python is extensible: It's easy to add new built-in functions or modules to your interpreter if you're programming in C, so you can perform critical operations as quickly as possible, or connect Python programs with libraries that are available only in binary code, such as a different vendor-supplied graphics library. When you're really on the line, you can connect the Python interpreter to an app written in C as an extension or command language for that application.
Python is named after the BBC's "Monty Python's Flying Circus" program, which has nothing to do with pythons.
  • 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.