Python entry 1/10 page

Source: Internet
Author: User
Chapter 1 Introduction to Python
The scripting language is similar to DOS batch processing and UNIX shell programs. The script language does not need to be compiled and then executed every time, and can easily access the running program during execution, or even dynamically modify the running program, it is suitable for rapid development and completion of some simple tasks. New features often need to be added when using the script language, but sometimes the script language is already very slow, very large, and very complex and cannot be implemented; or, the required functions involve system calls or other functions that can only be provided by the C language. the problem to be solved is not important to the extent that the C language must be used for rewriting. or, to solve the problem, data types such as variable-length strings (such as the ordered list of file names) are required. such data types are very easy in scripting languages, and C language requires a lot of work. or, programmers are not familiar with the C language: in these cases, they can still use the script language.

In this case, Python may be suitable for your needs. Python is easy to use, but it is a real programming language and provides more structures and support for large programs than shell. On the other hand, it provides more error checks than C. It is a very advanced language with a variety of built-in advanced data structures, such as flexible arrays and dictionaries, it may take several days for these data structures to be implemented efficiently in C. Because Python has a more general data structure, it is wider than Awk or even Perl, and many things are at least as easy in Python as in these languages.

 

Python allows you to break down a program into modules, which can be reused in other Python programs. It comes with a large number of standard modules that can serve as the foundation of your own programs-or as an example of learning Python programming. The system also provides file input and output, system calls, sockets (sockets), and even general interfaces of the window system (STDWIN.

 

Python is an interpreted language, which saves a lot of time for program development because it does not require compilation and connection. The interpreter can interact with each other, so that you can easily test the features of the language, write a program only once, or test the function from the bottom up program development. It is also a convenient calculator.

 

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

 
The advanced data structure allows you to use a statement to express complex operations;
Composite statements depend on indentation rather than brackets indicating start and end;
Variable Declaration or parameter declaration is not required.
Python is extensible: If you program in C, it is easy to add new built-in functions or modules to the interpreter, so that you can perform key operations as quickly as possible, or connect Python programs with libraries that can only be provided using binary code (for example, graphics libraries provided by different vendors. When you get really running, you can connect the Python interpreter to an application written in C and use it as an extension or command language for the application.
Python is named by the BBC's "Monty Python's Flying Circus" program and has nothing to do with Python.

Current 1/10 page12345678910 Next page

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.