python文件读写
来源:互联网 发布:怎么看待网络暴力 编辑:程序博客网 时间:2024/06/05 20:31
1 # File: fileWR.py 2 # --------------- 3 # DATE: 20170829 4 5 some_sentences = '''\ 6 I love learning python 7 because python is fun 8 and also easy to use 9 ''' 10 11 f = open('sentences.txt', 'w') 12 f.write(some_sentences) 13 f.close() 14 15 f = open('sentences.txt', 'r') 16 while True: 17 line = f.readline() 18 if len(line) == 0: 19 break 20 print(line) 21 f.close()
阅读全文
0 0
- python--python读写文件
- Python读写Unicode文件
- python Ini文件读写
- Python读写文件
- Python读写文件
- Python读写ini文件
- Python读写文件
- Python读写文件
- Python文件的读写
- python读写文件
- python文件读写
- [Python]读写文件方法
- python 文件读写操作
- Python文件读写操作
- Python读写文件
- python之读写文件
- python读写文件
- python文件的读写
- 二十位活跃在github上的国内技术大牛
- 强联通分量的tarjan算法
- 8.26模拟赛
- 在C++程序中调用被C编译器编译后的函数为什么要加extern“C”?
- HOJ 1917 POI 2001 Peaceful Commission 2-SAT问题
- python文件读写
- 变才是不变
- 加载动画效果(圆形转圈)-1
- Foreign Postcards Gym
- 2017年,年终总结-“是有多幸运”!
- Python多进程——进程池Pool
- E
- 在O(1)时间复杂度删除链表节点
- [Offer收割]编程练习赛24