While working with Tkinter, I have created two lists as below.
list1=['Archie']
list2=['mynameisarchie']
Within a function, I have defined a condition as follows.
def clicked():
global list1
global list2
count=0
count1=0
if e4.get() in list1:
count+=1
if e5.get() in list2:
count1+=1
if count!=0:
messagebox.showinfo('Problem', 'Username Already in Use')
if count1!=0:
messagebox.showinfo('Problem','Password Already in Use')
count2=count+count1
if count2==0:
messagebox.showinfo('Congrats','Successfully Registered')
If count2==0, then I want the values of e4.get() and e5.get() to get appended to list1 and list2.
When I run the program and the user enters some value in e4 and e5 and say it satisfies the above condition, I want those values to get permanently appended in the list such that even if I kill the program and run it again, the appended values are retained in the list and are utilised in the comparison shown in the code.
Is it possible to do so?
P.S - list1 and list2 are not present within any function and are independent.