Can someone help me with my python code my datasheet.txt doesn’t…
Question Answered step-by-step Can someone help me with my python code my datasheet.txt doesn’t… Can someone help me with my python code my datasheet.txt doesn’t show the data that I’ve input also can you explain me the necessary codes used for recording the data inside a file. here is my source codefrom tkinter import*from tkinter import messageboximport ast#windowwindow=Tk()window.title(‘Signup’)window.geometry(‘925×500+300+200’)window.configure(bg=”red”)window.resizable(False,False)#signup error handling and data inputdef signup(): username=user.get() password=code.get() confirm_password=confirm_code.get() if password == confirm_password: try: file=open(‘datasheet.txt’, ‘r+’) d=file.read() r=ast.literal_eval(d) dict2.ast={username:password} r.update(dict2) file.truncate(0) file.close() file=open(‘datasheet.txt’, ‘w’) w=file.write(str(r)) messagebox.showinfo(‘Signup’, ‘Successfully signed up’) except: file=open(‘datasheet.txt’,’w’) pp=str({‘Username’:’password’}) file.write(pp) file.close() else: messagebox.showerror(‘Invalid’, “Both Password should match”)#imageimg = PhotoImage(file=’llanera.png’)Label(window,image=img,bg=’white’).place(x=-10,y=-50)#frameframe=Frame(window,width=350,height=390,bg=’white’)frame.place(x=520,y=50)heading=Label(frame,text=’Sign up’, fg=’#57a1f8′,bg=’white’,font=(‘Microsoft YaHei UI Light’,23,’bold’))heading.place(x=117,y=5)#usernamedef on_enter(e): user.delete(0,’end’)def on_leave(e): name=user.get() if name == ”: user.insert(0,’Username’)user = Entry(frame,width=25,fg=’black’,border=0,bg=’white’,font=(‘Microsoft YaHei UI Light’,11,’bold’))user.place(x=30,y=80)user.insert(0,’Username’)user.bind(‘


