#!/usr/bin/env python
# -*- coding:utf-8 -*-
#*************#
Title: test.py
Author: Shi
Creat Date: 2018-03-03
Modify Author:
Modify Date:
Python Version: 3.5
#!/usr/bin/env python
区别于#!/usr/bin/python
的目的是防止安装python的时候没有装在默认路径,它可以自动在系统环境变量env中查找python目录。
# -*- coding: utf-8 -*-
python2.x 编码方式是 ASCII
python3.x 编码方式是 unicode( 可以不加)
Python会将圆括号, 中括号和花括号中的行隐性连接,可以通过换行来保持每行的长度不超过80个字符。
a = ''' is string,
let us test,
again,again,'''
不要在逗号,冒号前加空格。
逗号后加空格
print(x, y)
for a in lst:
二元操作符两边都加一个空格,如: = ,+, -
x = y
1 + 2
import 导入:
导入顺序:
- 标准库
- 第三方库
- 自定义
缩进,使用4个空格,不用Tab
网友评论