每一行的最大长度为80个字符,不要超过80,除了注释中的URLs。
不要使用反斜线进行换行。
import引用时
from Tkinter import Tk, Frame, Button, Entry, Canvas, Text
from Tkinter import LEFT, DISABLED, NORMAL, RIDGE, END
# 或
from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END)
不要:
from Tkinter import Tk, Frame, Button, Entry, Canvas, Text, \
LEFT, DISABLED, NORMAL, RIDGE, END
函数调用时
foo_bar(self, width, height, color='black', design=None, x='foo',
emphasis=None, highlight=0)
if判断时
if (width == 0 and height == 0 and
color == 'red' and emphasis == 'strong'):
长字符串声明时
x = ('This will build a very long long '
'long long long long long long string')
注释中的URLs
# See details at
# https://www.example.com/us/developer/documentation/api/content/v2.0/csv_file_name_extension_full_specification.html