Python怎么读写文本文件
Python如何读写文本文件?1. 读取文本文件代码:# coding: utf-8f open(test.txt)print 文件名:, f.na
Python如何读写文本文件?
1. 读取文本文件代码:
# coding: utf-8f = open('test.txt')print '文件名:', f.nameprint '是否处于关闭状态:', f.closedprint '打开的模式:', f.mode运行结果:root@he-desktop:~/python/example# python read_info.py 文件名: test.txt是否处于关闭状态: False打开的模式: r