for example i have this text file: subj.txt and it contains the texts below (subject|time)
astro1|1:00-2:00
act2|2:00-3:00
speech1|4:00-5:00
Btw, i'm using tkinter to create a gui. when a button is clicked, a window with text entry will appear and the program will ask the user to input what course will be deleted. So when a user selects astro1 and the button is clicked, the astro1 will be deleted in the textfile and the ac2 and speech 2 will go up. What is the code for that?
For example I have an entrybox with name self.courseent and i have a function below for the button:
f=open("subj.txt",'r')
for x in f:
a=x.split('|')
if self.courseent.get()==a[0]:
#the line where the a[0] will be deleted