python 文件操作
2010-07-28 17:58
295 查看
简明 Python 教程 中的例子,python 运行出错,用open代替file()。可以运行。
poem='''/
Programming is fun
When the work is done
if you wanna make your work also fun:
use Python!
'''
f=open('E://test.txt','w')
f.write(poem)
f.close()
f=open('E://test.txt','r')
while True:
line=f.readline()
if len(line) == 0:
break;
print (line)
f.close()
相关文章推荐
- Python学习笔记——文件对象和操作(1)
- Python入门(六)——self,类,方法,__init__,类对象,类变量,文件操作,判断回文,pickle模块用法
- Python 文件操作
- Python文件操作类操作实例详解
- Python使用difflib对比两个文件操作实例
- Python 3.6 读取并操作文件内容的实例
- python学习文件简单读写操作
- Python3.4文件目录操作
- Python模块学习:tempfile 临时文件(夹)操作
- Python的shutil模块中文件的复制操作函数详解
- python天天进步(2)--文件操作之遍历目录
- Python 文件操作
- python文件操作
- 2.22python基础(3) 文件操作
- Python实现ini文件操作
- python中对文件、文件夹的操作
- python文件和目录操作函数小结
- python对文件的操作方式总结
- python 文件与目录操作
- python 关于文件的一些操作