I want to delete a specific line in a text file in python. for example, say in my text file I have:
Ben Walsh - 768
James Cook - 659
Jamie Walsh - 4359
Owen Perkins - 699
Dylan Thomas - 1574
Adam Ward - 987
Allen Woodhouse - 599
I want to delete any line that contains the number 699
.
How do I do this?
I have tried using this to solve it,Deleting a specific line in a file (python) however, using Tkinter I am asking the user to enter the number of the person they want to delete. So the number decides what is deleted because there are other items on the line it does not delete it.