python使用with自动关闭资源

with open('test.txt', 'w') as f: f.write('test')
相关文章
相关标签/搜索