python读取文件指定行内容

python读取文件指定行内容

import linecache
text=linecache.getline(r'C:\Users\Administrator\Desktop\SourceCodeofMongoRedis\chapter_5\generate_string.py',10)
第十行内容为# info = '''1000001 王小小'''

 

posted @ 2020-03-01 23:52  阿布_alone  阅读(8990)  评论(0编辑  收藏  举报
TOP