Question: How to separate this python program into a model view controller format from tkinter import * window = Tk() def toPounds(): text1.insert(END, (float(entry1_value.get() * 2.204)))

How to separate this python program into a "model view controller" format

from tkinter import *

window = Tk()

def toPounds():

text1.insert(END, (float(entry1_value.get() * 2.204)))

def toKilos():

text1.insert(END, (float((entry1_value.get() / 2.204)))

entry1_value=DoubleVar()

entry1 = Entry(window, textvariable=entry1_value)

entry1.grid(row=2, column=2)

button1 = Button(window, text="toPounds", command=toPounds)

button1.grid(row=3, column=1)

button2 = Button(window, text="toKilos", command=toKilos)

button2.grid(row=3, column=3)

text1 = Text(window, height=1, width=5)

text1.grid(row=4, column = 2)

window = Label(window, text="Weight Conversion")

window.grid(row = 1, column = 2)

window.mainloop()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!