Python学习之文件读写
来源:互联网 发布:php工程师发展前景 编辑:程序博客网 时间:2024/05/16 10:09
相关函数:
open(“x”,”y”)——x为文件存储路径,y为类别(w/r,即写或读)
close()
write(“xxx”)
writelines(“xxx”)
例:(读写文件test,并打印)
path=”D:test.txt”
f=open(path,”w”)
f.write(“Hello world!\n”)
f.writelines(“This the second line.”)
f.close()
f=open(path,”r”)
for line in f:
print line
f.close()
0 0
- Python学习之文件读写
- python之读写文件
- Python之文件读写
- Python之文件读写
- Python之读写文件
- python之文件读写
- python学习之路三(文件读写)
- Python学习笔记--文件读写
- 学习 Python 文件的读写
- Python学习(文件读写)
- python学习笔记 文件读写
- Python之gzip文件读写
- python之读写excel文件
- python之读写csv文件
- linux学习之读写文件
- python文件读写实例学习笔记
- Python学习笔记(3)--文件读写
- python 学习笔记 错误调试 文件读写
- PHP中include和require的区别详解
- WebSocket详解
- Android Studio for Mac
- WinForm程序安装以后提示错误解决方法
- 下半年,别忘给自己一个改变的机会!
- Python学习之文件读写
- This message can be disabled via the detect_slow_plugins global setting。
- eclipse中配置tomcat插件的步骤
- 海思开机启动画面
- (Servlet)Ajax
- 数据库-基本的SQL语句
- 为什么智能家居只闻名不见影
- 【jQuery插件】-----全屏插件fullpage
- 30、tar命令