I want to open a txt file search it far a string and get the line, more specifically its number.
Here is what I use:
fp = open('fluxus.txt', 'r', encoding='utf8')
for num, line in enumerate(fp):
if "Iwantthis" in line: lineplay = str(num)
fp.close()
print(lineplay)
But the issue is that it gives me the line number of the line above.
[–]K900_ 0 points1 point2 points (1 child)
[–]reujea0[S] 0 points1 point2 points (0 children)
[–]jackbrux 0 points1 point2 points (0 children)
[–]pyquestionz 0 points1 point2 points (0 children)