![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Vincent_ZhaoYongkun
这个作者很懒,什么都没留下…
展开
-
python 读取用户键盘输入
import sys #使用for循环遍历标准输入 for line in sys.stdin: print("用户输入:" , line , end = '')转载 2019-06-28 17:07:23 · 1147 阅读 · 0 评论 -
python 随机读取文件指定行
import linecache import random # 读取random模块的源文件的第3行 print(linecache.getline(random.__file__, 3)) # 读取本程序的第3行 print(linecache.getline('linecache_test.py', 3)) # 读取普通文件的第2行 print(linecache.get...原创 2019-06-28 17:15:28 · 2581 阅读 · 0 评论