f=open("new.txt","w")
print(f.closed)
f.write("hello")
f.close()
print f.closed
with open("new1.txt","w")as g:#上下文管理器 with as
print(g.closed)
g.write("hello,world!")
print (g.closed)
添加回答
举报
0/150
提交
取消