【发布时间】:2020-04-04 02:22:59
【问题描述】:
如果用户输入的string存在于文本文件中,程序应该在文本文件中找到/return行号和printline number
kw 是用户输入 btw
一些代码供参考:
def DELITEM():
kw = Dele.get()
with open('notify.txt') as f:
if kw in f.read:
print('the number of the line kw is in')
【问题讨论】:
-
这能回答你的问题吗? Deleting certain line of text file in python
标签: python python-3.x file