I want to know if there is a way to find the line number of a line in a text file, using Python.
So, for example, if we have the file textfile.txt
:
abc
deff
ghi
jkl
EOF
Then I'd like a function like func(FILE,TEXT)
, that would work in the following way:
Input: func(textfile.txt, "ghi")
Output: 3