Python Forum

Full Version: compare entry with value inside file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a tkinter entry and I will get a number from user as string since I am using entry. Then I am checking a file entry that has a number which is considered as string as well (from my basic understating). I need to compare them and check if same or not.

entry = Entry(session_start)
entry.config(show="*")
entry.grid(row=8,column=1)

#entry is from user and thenum is from file
if entry == thenum:
    complete_purchase()
  else:
    Label(session_start, text= "not same!").grid(row=11,column =0)
Then I read a line from a file that
has the number I want to check against

so for example in the entry I put 123
in the file the number is 123

how to check that if they are the same or not.

Thanks
entry.get()
to use the method to get the value from the entry, by only using entry it is a pointer to the actual entry itself.