I am trying to write a python tkinter program that calculates time in seconds of a set number of beats at a certain bpm. Anyways i am having a hard time using the tkinter enters as float variables. I am wanting some suggestions on how to make my code work. I am an beginner programmer so my code is prolly kinda shaky, Thanks. Here is my code...
window = Tk()
window.title( 'Bpm Timeslicer' )
intro = Label(window, text='Enter a Bpm and enter a number of beats, and the program will calculate sample time in seconds')
bpmL = Label(window, text='BPM')
bpmIn = Entry(window)
beatsL = Label(window, text='Number of beats')
beatsIn = Entry(window)
timeOut = Label(window, text='Time:')
def run():
bpm = bpmIn.get()
beats = beatsIn.get()
bpm = float(bpm)from tkinter import *
beats = float(beats)
time1 = float(0)
min = 0
perc = 0
perc = beats / bpm
time1 = min * perc
timeOut = Label(window, time1)
btn_run = Button( window, text = 'Run', command=run )
btn_end = Button( window , text = 'Close', command=exit )
intro.pack()
bpmL.pack()
bpmIn.pack()
beatsL.pack()
beatsIn.pack()
timeOut.pack()
btn_run.pack()
btn_end.pack()
window.mainloop()