I am using following code to find all the lines which contains ':' special character. Later I am trying to remove those lines from the file -
myFile = open('myPOST.txt', 'rb')
myText = myFile.readlines()
for line in myText:
line.find(":") == "-1"
if line.find(":"):
Is there any function in python that returns exactly the line where this character is found (find() returns either -1 or location of the searched character in the line) Or if I use find() only then how to delete exactly those lines for which the value of find() is -1?
for line_no, line in enumerate(myText)