Python Forum
TypeError: 'Table' object is not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: 'Table' object is not callable
#14
from tkinter import *
 
# Create Window Object
window = Tk()
# Define table contents (each row/column)
l1 = Label(window, text="Name")
l1.grid(row=0, column=0)
 
l2 = Label(window, text="Monthly Income")
l2.grid(row=1, column=0)
 
l3 = Label(window, text="Monthly Budget")
l3.grid(row=2, column=0)
 
l4 = Label(window, text="Monthly Expenses")
l4.grid(row=3, column=0)
 
# Define Entries
name_text = StringVar()
e1 = Entry(window, textvariable=name_text)
e1.grid(row=0, column=1)
 
Monthly_Income_text = StringVar()
e2 = Entry(window, textvariable=Monthly_Income_text)
e2.grid(row=0, column=2)
 
Monthly_Budget = StringVar()
e3 = Entry(window, textvariable=Monthly_Budget)
e3.grid(row=0, column=3)
 
Monthly_Expenses = StringVar()
e4 = Entry(window, textvariable=Monthly_Expenses)
e4.grid(row=0, column=4)
 
# Define ListBox
list1 = Listbox(window, height=35, width=35)
list1.grid(row=2, column=0, columnspan=2)
 
# Attach scrollbar to the list
sb1 = Scrollbar(window)
sb1.grid(row=2, column=2, rowspan=6)
 
list1.configure(yscrollcommand=sb1.set)
sb1.configure(command=list1.yview)
 
# Define buttons
b1 = Button(window, text="View All", width=12)
b1.grid(row=2, column=3)
 
b2 = Button(window, text="Search Entry", width=12)
b2.grid(row=3, column=3)
 
b3 = Button(window, text="Add Entry", width=12)
b3.grid(row=4, column=3)
 
b4 = Button(window, text="Update Selected", width=12)
b4.grid(row=5, column=3)
 
b5 = Button(window, text="Delete Selected", width=12)
b5.grid(row=6, column=3)
 
b6 = Button(window, text="Close", width=12)
b6.grid(row=7, column=3)
 
window.mainloop()
that is what your gui looks like
   

Please note that this is based on your code, but in fact it can be written much better, e.g. iIt would be better to create using OOP approach.

I would recommend reading https://anzeljg.github.io/rin2/book2/240...index.html
IT IS VERY OUTDATED TUTORIAL and a lot has changed, but still it's one of the most comprehensive tutorials on tkinter
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: TypeError: 'Table' object is not callable - by buran - Jan-21-2020, 09:14 PM

Forum Jump:

User Panel Messages

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