目录

Python文件操作-with open

3

with open 可以快捷的打开文件,并且不再需要手动关闭文件,简化了文件的操作

with open('/etc/password', mode='r') as fr:
	fr.readline()

推荐文章

Python-if判断
Python-运算