Introduction to Python:
1.Python is an interpreted, object-oriented, dynamic data type of high-level programming language. Since the the early 1990s Python language was born, it has been widely used in processing system management tasks and web programming. Python has become one of the most popular programming languages. In January 2011, it was ranked as the 2010 language by the Tiobe programming language leaderboard. Since 2004, Python usage has grown linearly.
2.Python is designed to adhere to a clear and consistent style, the Python author intentionally design a very restrictive grammar, so that bad programming habits (such as the next line of the IF statement is not indented to the right) can not be compiled. One of the most important is the Python indentation rules. The difference between one and most other languages, such as C, is that the bounds of a module are determined entirely by the position of the first character of each line in that line (and the C language is explicitly defined by a pair of curly braces {} to define the bounds of the module, which has no relation to the position of the character). This has been controversial. Since the birth of a language such as C, the grammatical meaning of the language is separated from the arrangement of the characters, which was once thought to be the progress of a programming language. It is undeniable, however, that Python does make the program clearer and more beautiful by forcing programmers to indent, including if,for and function definitions, where all the modules need to be used.
Advantages and disadvantages of 3.Python: (1) Simple ———— Python is a language that represents the idea of simplicity. Reading a good Python program feels like reading English, even though the requirements of this English are very strict! This pseudo-code nature of Python is one of its greatest advantages. It allows you to focus on solving problems rather than figuring out the language itself. (2) Easy to learn, fast, free open source, portability and so on. Disadvantage: (1) The first is the code can not be encrypted, because Python is an explanatory language, its source code is stored in clear text, so, in the future when you write the project may need to pay attention to the issue of encryption. (3) Slow operation, here is compared with C and C + +. Of course, this is invisible to our eyes.
The above is my simple understanding of python, if there are deficiencies, please give advice,
Installation of Python:
About Python, now the teacher recommended us is the choice of Python3 version, I heard that there are still some companies or version of the 2,python installation is to the official website (HTTP/ www.python.org) Select the version that is appropriate for your PC (Windows or other systems) and follow the prompts to install it, but here's one thing to note, if you can't find Python in the Command box after installation, you might want to consider the issue of environment variables, as follows: click Computer Right-click on the display of properties, click on the discovery of advanced system settings, click Open, there is an environment variable, click Open, find the second content box inside the path, the Python directory to add to this inside the line, to note that when adding a semicolon after the previous directory, If you feel that I do not express clearly the following:
Then it's almost ready, and there should be no problem.
The first Python program: This program is great
First look at your version:
Start--"cmd-to-CD C: \-->dir
cd = Change Directory
Dir = view the current directory file list
, I think it is very magical, did not think of computer language so wonderful. Of course, we can also build a. py file, which writes this program, and then executes the directory of this file, can also be implemented,
, here I have to explain, about the. py file suffix, which makes it clear that this is a Python program, then what are the suffixes? As follows:
. txt Notepad text file
. doc Word File
. xls Excel File
. ppt ppt File
. exe executable file
. jpg. png. JPEG pictures
. gif animated Pictures
. pdf PDF File
. mp4. avi Video
. py Python File
. Java Java File
. C. h C source code
. php php File
. js JavaScript
Introduction to Python and installation and first program and usage