Created
November 27, 2019 01:05
-
-
Save yatakeke/0881a7a16a1550b8437f7788c4e868ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# linecache module allows one to get any line fromm python source code file | |
import linecache | |
linecache.getline(filename, line_number, module_globals=None) | |
# get line line_number from file named filename | |
# ex. line = linecache.getline('./test.txt', 8) | |
# get 8th line from test.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment