Python 循环体在文件中的使用
来源:互联网 发布:java oa办公系统源码 编辑:程序博客网 时间:2024/05/17 22:13
<span style="font-size:18px;"># while循环在文件中的使用,输出打印文件内容fr = open("aaa.py",'r')s = fr.readline()while s != '': #s不等于 空 print s s = fr.readline()print "1读取完成"print '\n'fr.close()# for循环在文件中的使用,输出打印文件内容fr = open("aaa.py",'r')for t in fr: print tprint "2读取完成"fr.close()</span>
0 0
- Python 循环体在文件中的使用
- break和continue语句在循环体中的作用
- getopt在Python中的使用
- pdf2htmlex在python中的使用
- Protobuf在Python中的使用
- getopt在Python中的使用
- getopt在Python中的使用
- 在python中的使用Libsvm
- ansible 在python中的使用
- List在Python中的使用
- getopt在Python中的使用
- Protobuf在Python中的使用
- 注释在Python中的使用
- grok在python 中的使用
- geopy 在python中的使用
- 第16课 Python循环体for遍历文件和元组
- 第29课 Python中for循环体与文件(迭代器解析)
- 函数编程-在循环体和异步回调中慎重使用闭包(closure)
- mysql count() 函数
- 超级简单使用Google的一种方式--无需翻墙
- Mybatis中的动态SQL语句以及一些其他的笔记
- 上传图片js判断图片尺寸和格式兼容IE
- 1004. 成绩排名 (20)
- Python 循环体在文件中的使用
- [刷题]Implement Iterator of Binary Search Tree
- dp,px的转换
- Java复习笔记5
- JSP中一些需要注意和经常忘记的问题
- Java有多少就业方向
- UItextfiled限制输入数字
- matlab simulink 中 gateway 参数设置
- STM32 中的 assert_param 函数