Why use Python:
Read/write, consistency, software quality
Advanced reuse mechanism to support software development
- Provide developers with efficiency:
Code is only Java or C + + 1/5~1/3
No need to compile links, improve the efficiency of Cheng
- Portability of the program:
User image interface, database access, Web-based systems, etc.
- Support for standard libraries:
- Component integration:
You can call a C or C + + library
Can be called by C and C + + programs
can be integrated in Java components
Software quality:
Concise and highly readable syntax
Minimalist design philosophy: Although there are often many ways to implement a programming task, there are often only one way to be clear
Python uses some tools, including modular design and OPP, to prompt the reusability of programs
Development efficiency:
Python takes less effort to complete more tasks
Concise syntax, dynamic type, no compilation, built-in toolkit
is Python "scripting language":
Python is a multi-purpose programming language, often playing the role of scripting language
Python can be defined as an object-oriented scripting language
People tend to describe Python code files as "scripts" rather than "programs"
"Scripts" tend to describe simple top-level code files
"Program" is used to describe a relatively complex number of files
There are three different roles for Python:
Implements tasks such as processing text files and invoking other programs
Python is more than just a good shell scripting language
When testing a hardware device, the application can invoke Python code without having to distribute or recompile the entire system code
Python's ease-of-use and flexibility make programming tasks easier
Often used for fast job tasks and long-term strategy development
What are the disadvantages of Python:
Python does not compile the code into the underlying binary code, and the Python program will be slower than a fully compiled language like C
The benefits of Python development speed are often more important than the loss of execution speed, and modern CPUs are getting faster
What to do with Python:
Python's built-in interface to operating system services makes it an ideal tool for writing portable management tools and parts (shell tools) that maintain operating systems
Python programs can search for files and directory trees, run other programs, process or thread parallel processing, etc.
Python's standard library binds POSIX and other general operating system (OS) Tools: Environment variables, files, sockets, pipelines, processes, multithreading, regular expression pattern matching, command-line arguments, standard stream interfaces, shell command initiators, file name extensions, and more
Python has built-in Tkinter's standard object-oriented interface tk GUI API, enabling Python programs to generate portable, native-looking GUI
Python provides a standard Internet module that can be used extensively in a variety of network tasks
Scripts can communicate via sockets, transfer files via FTP, get web pages via URLs, communicate via XML-RPC, soap and Telnet, and more
Python can be extended through a C + + system with the ability to nest features of A/C + + system
Embed python in the product to allow individual customization of the product without recompiling the entire product or the source code
Python provides an interface to all major relational databases
The components written in Python or C all look the same, and you can use Python to prototype the system at the outset and then port the component to a compiled language such as C or C + +. Python does not need to be rewritten when the prototype is determined
- Numerical computation and scientific calculation programming:
Python provides interfaces to matrix objects, standard math libraries
- Games, images, artificial intelligence, XML, robotics, etc.
Use Python to program graphics games using the Pygame system
Interface communication on Windows, Linux, and more systems with psserial extensions
Image processing with PIL, Pyopengl, Blender, Maya, and other tools
XML parsing with XML libraries, xmlrpclib modules, and other third-party extensions
......
Python has some of the technical advantages:
Python is an object-oriented language that supports advanced concepts such as polymorphism, operator overloading, and multiple inheritance
Python is completely free to use and distribute.
The standard implementation of Python is written by the portable ANSI C
Python can run on the following platforms:
Linux and UNIX, Windows and DOS, Mac OS, BeOS, and more
Python is a hybrid, rich in tools that make it between traditional scripting languages (TCL, Perl) and system languages (c, C + +)
Python keeps track of the kinds of objects at any time during the run, without requiring the code to declare complex types and sizes
-
- Automatic memory Management:
Python automatically assigns objects and automatically revokes objects when they are no longer in use ("garbage collection")
To be able to build a larger system, Python contains modules, classes, and exception handling tools
Python provides common data structures as a basic part of the language, such as: List, dictionary (dictionary), string
Python comes with many powerful standard operations, including merging (concatenation), sharding (slice), sorting (sort), and mapping (mapping)
Python presets A number of pre-compiled library tools, from regular expression matching to network support
Python's C language can help Python programs to invoke C programs flexibly
Python is a mix of library files written in C or C + +, making Python a front-end language and custom tool
Run a Python program to simply type the Python program and run it, without the intermediate steps such as compiling and linking required by other languages
The core of the Python language is very simple and easy to learn
Python eggs:
To understand the complete philosophy of Python, type the import this command in any Python interaction interpreter. Describes a series of Python design principles
Python is engineering, not art:
The creator of Python is trained by mathematicians, and Python is like math, and its design is orthogonal (orthogonal), for example: moving to Master Python's polymorphism, leaving only the details.
Writing unique, skillful code, often a source of pride between Perl users, Perl is a descriptive language
Python is best for Perl's description language: Python's syntax model almost forces the user to write readable code that can be used for a long time after it is first written
1-Understanding Python