GUI Python Temperature Converter help!! This is in python 2.7 and I can’t figure out how to configure my radio buttons to work with the functions. Please help! from Skinter import * def convert():= celTempVar.get() fahTemp = fahTempVar.get() if celTempVar.get() != 0.0: celToFah = (celTemp * 9/5 + 32) print celToFah fahTempVar.set(celToFah) elif fahTempVar.get() != 0.0: fahToCel = ((fahTemp - 32) * (5/9)) print fahToCel celTempVar.set(fahToCel) #root root = To() root. Title ("Olivia's Temperature Converter") root. Geometry("400x200") #GUI setup L1=Label(root, text="Temperature Converter", font=("Times",20), bag = "yellow", fr = "blue",) L2=Label(root, text="""Pick Conversion Type:""",) R1=Radio button(root, text="Celsius to Fahrenheit", variable=redbone, value="Celsius", command = celTempVar.get) R2=Radio button(root, text="Fahrenheit to Celsius", variable=redbone, value="Fahrenheit", command = fahTempVar.get) L3=Label(root, text="Enter the temperature to convert:") E1=Entry(root, text variable = celTempVar.get) some button=Button(root, text="Convert Temperature", command=convert) L1.pack() L2.pack() R1.pack(anchor=CENTER) R2.pack(anchor=CENTER) L3.pack() E1.pack()somebutton.pack()
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here