Python Forum
Test program returns int (I want int) and real one returns tuple (not wanted)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Test program returns int (I want int) and real one returns tuple (not wanted)
#15
(Mar-25-2020, 08:53 PM)chesschaser Wrote: Everything is important!

Actually, your original problem can be reproduced with 13 lines of code. At that point (and probably long before that) you would have spotted the problem.
from tkinter import *

class SearchWin:
    def searchList(self):
        elements = int(itembox.size())
             
    def __init__(self):
        self.searchPrompt = Tk()
        self.searchPrompt.geometry("150x150")
        searchbtn = Button(self.searchPrompt, text = "Search", command = self.searchList)
        searchbtn.pack()
 

s=SearchWin()
itembox = Entry(width = 50)
itemslist = Listbox(listvariable = itemsvar)
s.searchPrompt.mainloop()
Note, I used your original code with very small modifications. In any case you have big problem with overall structure of your code
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Test program returns int (I want int) and real one returns tuple (not wanted) - by buran - Mar-26-2020, 10:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Entry returns NONE mollerpunker 2 2,537 Dec-06-2020, 06:50 PM
Last Post: DT2000

Forum Jump:

User Panel Messages

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