Всякий раз, когда я пытаюсь использовать информацию из поля ввода, результат, такой как ".56424824", является результатом.
def MainLogin(Username,Password):
file = open("UserLogins.txt","r")
file_reader = csv.reader(file)
user_find(file_reader,Username)
file.close()
def user_find(file,strUsername):
for row in file:
if row[0] == strUsername:
print("Username found: " +strUsername)
user_found = [row[0],row[1]]
print(user_found)
pass_checker(user_found)
break
else:
print(strUsername)
print(row[0])
print("Not found")
def pass_checker(user_found,strPassword):
if user_found[1] == strPassword:
print("pass match")
else:
print("pass Invalid")
def login():
global toDestroy
Login = Tk() # Create window.
Login.geometry("1000x700+300+0") # Change size and position of window.
Login.title("Login_Screen") # Give window a name.
Login.config(bg="white")
toDestroy.destroy()
toDestroy = Login
Title = Label(Login, text='Login Screen')
Title.configure(font="Helvetica 12 bold")
Title.grid(column=0, row=1)
giveUsername= Label(Login, text='Username:')
giveUsername.grid(column=0,row=2)
Username= Entry(Login)
Username.grid(column=1,row=2)
givePassword= Label(Login, text='Password:')
givePassword.grid(column=0,row=3)
Password= Entry(Login, show='*')
Password.grid(column=1,row=3)
strUsername= Username.get()
strPassword= Password.get()
Submit= Button(Login,text='Submit.', command=lambda:MainLogin(Username,Password))
Submit.grid(column=1,row=4,sticky='e')
Submit.bind('<Return>',exe)
backButton = Button(Login, text="Back To Main Menu.", command=lambda:toMenu(toDestroy))
backButton.grid(column=0, row=0)
createButton = Button(Login, text="Create a new user", command=create)
createButton.grid(column=0,row=4, sticky='w')
return toDestroy
return strUsername
return strPassword