Class 1
First, Introduction
Python: scripting language, interpreted language
Indentation is a very important sign of the Python language.
Python3 is the future development trend
Second, installation
Windows:
1. Download the installation package:
https:
/
/
www.python.org
/
downloads
/
2、安装:
默认安装路径:C:\python2.7
3、配置环境变量
【右键计算机】
-
-
》【属性】
-
-
》【高级系统设置】
-
-
》【高级】
-
-
》【环境变量】
-
-
》【在第二个内容框中找到 变量名为Path 的一行,双击】
-
-
> 【Python安装目录追加到变值值中,用 ; 分割】
如:原来的值;C:\python27,切记前面有分号
linux & mac
系统默认已经安装
Third, the first procedure
print("hello world")
指定解释器:如果想要类似于执行shell脚本一样执行python脚本,例: ./hello.py
,那么就需要在 hello.py 文件的头部指定解释器,如:
#!/usr/bin/env python
执行前需给予 hello.py 执行权限,chmod 755 hello.py
Iv. Variables & Character encodings
Variable name definition rules:
1、
Variable names can only be any combination of letters, numbers, or underscores
2. The first character of a variable name cannot be a number
3. Variable name cannot be a keyword
4, the variable name can not contain spaces and special characters (_ except)
Code:-*-coding:utf-8-*-
Five, module
Python has a rich and powerful library of standards and third-party libraries, which can be implemented in a non-language comparable capacity.
There is an unknown table here, and then record it after learning.
Python Learning Notes (i) Introduction overview