标签:python基础 python python脚本 文件操作 文件读写
# -*- coding: cp936 -*-# close()
例子:
wf = open("file1.txt","w")
wf.write("use python to write file")
wf.close()
# 读文件
rf = open("file1.txt","r")
list = rf.readlines()
print list[::]
标签:python基础 python python脚本 文件操作 文件读写
原文地址:http://blog.csdn.net/xufeng0991/article/details/39668045