I\'m trying to delete a specific line that contains a specific string.
I\'ve a file called numbers.txt with the following content:
You can use regex.
import re if not re.match("^tom$", line): output.append(line)
The $ means the end of the string.
$