Answer the question
In order to leave comments, you need to log in
How to find and remove all required lines in python?
There are many links in the file.
How to run through the file and delete everything that starts with http or https until the end of the url and no more? Without using an additional file.
I know how to do it in bash but not in python.
Tried like this:
for files in what_in_dir:
o = open(i,'a')
data = open(i).read()
o.write( re.sub(r'^http://*$','',data) )
o.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question