1. Python is a high-level programming language for explanatory, compiled, interactive languages, object-oriented, dynamic data types.
1.1 Interactive: means that you can directly interact with the program you write at a prompt.
1.2 Explanatory: This means that there is no compilation of this link during the development process.
1.3 Object-oriented: it means that it supports object-oriented styles, or code encapsulation in object programming techniques.
2. Python complies with the GPL (GNU general public License) agreement.
3. Features of Python
Relatively few keywords, simple structure has a well-defined syntax, code definition is clear, easy to maintain, has a rich library, cross-platform in the system compatibility is good based on open source features, can be ported to many platforms, can call C or C + + part of the code, it also provides interfaces to all major business databases. You can create and migrate to many system calls.
4. Construction of the environment
Python download: Go to the python website https://www.python.org/download
Python Document: https://www.python.org/doc/
5. Installation of Python
such as Baidu experience
6. Environment variable Configuration
Configure the Python installation directory in My Computer--Properties--Advanced environment variable--path.
Or, in the command prompt (cmd), enter
path=%path%; C:\python,C:\python for its installation directory, and then press Ebter
7. Chinese encoding
We can use Python to enter English, but when we need to input Chinese, there may be garbled or error cases.
Because Python's default encoding format is Asc| |, it is not possible to print Chinese characters without modifying the encoding format, so the error will be
Workaround: You can add #-*-coding:utf-8-*-or #coding =utf-8 at the beginning of the file .
Note: #coding =utf-8 = no spaces on either side.
The first code of the program is as follows:
#!/usr/bin/python
#-*-Coding:utf-8-*-
Print "Ni hahaha";
Note: python3.x source files use utf-8 encoding by default, so you can parse Chinese normally without specifying UTF-8 encoding.
Note: If you use the editor and you need to set the PY file storage format to UTF-8, you will receive an error message similar to the following:
To modify a step:
File-setting-file encodings, you'll understand.
Python Learning Summary (i), the first Python program is written