(カーソルを操作しない)Pythonファイル指定行の内容を読み込む
757 ワード
Pythonファイル指定行の内容を読み込む
import linecache text=linecache.getline(r'C:UsersAdministratorDesktopSourceCodeofMongoRedischapter_5generate_string.py',10)10行目の内容は
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 '''