Simple library to edit or read text of specific line.
2020/12/20 - Now lineditor available on PyPI !
A. From PyPI ( stable )
pip install lineditor
B. From GitHub ( latest )
pip install git+https://github.com/mafusuke/lineditor.git
import lineditor
# load the target file
file = lineditor.Editor("./hoge.txt")
# print the string on the 10th line
print(file[10])
# modify the string on the 21th line into "new text"
file[21] = "new text"
# total lines count of the file
print(len(file))