Python Forum
[Tkinter] compare entry with value inside file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] compare entry with value inside file
#1
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
Reply
#2
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.
rwahdan likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get selected text inside an Entry Jerdup 0 2,474 Aug-20-2020, 12:42 PM
Last Post: Jerdup
  [Tkinter] Unable to get current contents of the entry field where the content is the file path pmpinaki 1 2,224 Apr-18-2020, 06:45 PM
Last Post: deanhystad
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 4,467 Jan-23-2020, 09:00 PM
Last Post: HBH
  [PyQt] Collect entry from textline Widget via UI file mart79 3 2,906 Aug-05-2019, 01:40 PM
Last Post: Denni
  [Tkinter] how to get the entry information using Entry.get() ? SamyPyth 2 3,499 Mar-18-2019, 05:36 PM
Last Post: woooee
  how to bind entry to a function in another file Rishav 1 3,009 Aug-07-2017, 04:34 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020