https://www.delftstack.com/zh-tw/howto/python/python-find-string-in-file/#%e5%9c%a8-python-%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%aa%94%e6%a1%88-readlines-%e6%96%b9%e6%b3%95%e6%9f%a5%e8%a9%a2%e6%aa%94%e6%a1%88%e4%b8%ad%e7%9a%84%e5%ad%97%e4%b8%b2
https://github.com/dokelung/Python-QA/blob/master/questions/file/Python%E5%A6%82%E4%BD%95%E5%AF%A6%E7%8F%BE%E4%B8%A6%E8%A1%8C%E6%9F%A5%E6%89%BE%E9%97%9C%E9%8D%B5%E5%AD%97%E6%89%80%E5%9C%A8%E7%9A%84%E8%A1%8C.md
建議使用下列 不要用 readline()
with open(‘XXX’, ‘r’) as f:
for line in f:
if ‘txt’ in line:
# do something…