i've been trying this weeks python activity but am unable to get it to work. This is wat i have done so far;Code
from Tkinter import *
class Product(Frame):
def __init__(self,master):
frame = Frame(master)
Frame.__init__(self, master)
self.grid()
self.create_widgets()
def create_widgets(self):
self.Text1 = Text(self, width=11, height=2, wrap=WORD)
self.Text1.grid(row = 0, column = 0, columnspan = 1, sticky = W)
self.Text2 = Text(self, width=11, height=2, wrap=WORD)
self.Text2.grid(row = 1, column = 0, columnspan = 1, sticky = W)
self.Text3 = Text(self, width=11, height=2, wrap=WORD)
self.Text3.grid(row = 3, column = 0, columnspan = 1, sticky = W)
self.btncalc = Button(self, text="Calculate Product", command=self.Calc)
self.btncalc.grid(row = 2, column = 0, columnspan = 1, sticky = W)
def Calc(self):
value1 = self.Text1.get()
value2 = self.Text2.get()
totalvalue = (value1 + value2)
self.Text3.insert(0.0, totalvalue)
root = Tk()
root.title("Product Calculator")
root.geometry("100x150")
app = Product(root)
root.mainloop()
[code]