Public feed #727000

Miscellany

public text v1 · immutable
Raw Edit
·published 2007-10-05 17:47 UTC
rendered paste body
#Michael Cusack
# Project 7-1

from Tkinter import *

def calc():

	o = 0
	i = int(str(e.get()))
	r = int(str(e2.get()))
	a = int(str(e3.get()))
	d = int(str(e4.get()))
	o = float((i*r) * (d/a))
	print o

window = Tk()
lbl = Label(window, text='Initial # of organisms:')
lbl.pack(side=TOP)
e = Entry(name='text')
e.grid(column = 0)
e.pack(expand = YES, fill = BOTH)
lbl2 = Label(window, text='Growth Rate:')
lbl2.pack(side=TOP)
e2 = Entry(name='text2')
e2.grid(column = 1)
e2.pack(expand = YES, fill = BOTH)
lbl3 = Label(window, text='Hours to achieve rate:')
lbl3.pack(side=TOP)
e3 = Entry(name='text3')
e3.grid(column = 2)
e3.pack(expand = YES, fill = BOTH)
lbl4 = Label(window, text='Hours population grows:')
lbl4.pack(side=TOP)
e4 = Entry(name='text4')
e4.grid(column = 3)
e4.pack(expand = YES, fill = BOTH)
b = Button(window, text='Calculate', command=calc)
b.pack(side=BOTTOM)
window.mainloop()