(カーソルを操作しない)Pythonファイル指定行の内容を読み込む


Pythonファイル指定行の内容を読み込む
 python         

import linecache text=linecache.getline(r'C:UsersAdministratorDesktopSourceCodeofMongoRedischapter_5generate_string.py',10)10行目の内容は
import linecache
text=linecache.getline(r'C:\Users\Administrator\Desktop\SourceCodeofMongoRedis\chapter_5\generate_string.py',10)
#      # info = '''1000001    '''