python中的with语句 1、with语句 例子: """ with.py 使用with语句打开文件 """ with open('day02') as f: # 生成文件对象 data = f.read() print(data) # with语句块结束 f对象被自动销毁