#! /usr/bin/env python # -*- coding: utf-8 -*- import Tkinter as tk class FullScreenApp(object): def __init__(self, master, **kwargs): self.root = master # self.tk.attributes('-zoomed', True) # This just maximizes it so we can see the window. It's no
在Python中,None.空列表[].空字典{}.空元组().0等一系列代表空和无的对象会被转换成False.除此之外的其它对象都会被转化成True. 1.0等于False,这点要注意. 2.空的list判断: if 0 == len(list) 或者 if list #空的list相当于False 而if len(list)则表示list不为空时,因为len(list)在等于0的时候为False,其他情况下为True. 3.判断是否为None: if X is None if not X