Answer the question
In order to leave comments, you need to log in
How to delete a line in a file using python?
The entire Internet was covered - everywhere only with replacements for spaces and the like. Nowhere can I find a function that could delete a line in a file without leaving a hyphen.
Answer the question
In order to leave comments, you need to log in
f = open('file.txt').read()
f = f.replace('YOUR_STRING\n','')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question