I have a functioning python script I'm wanting to integrate into a UI I created using pyqt5. I'm having trouble with the radio buttons.

I've attached a pic of the UI. The Idea is the user inputs a value into the top text box, then click the radio button indicating which way they want the conversion to be performed then click the action button to perform the calculation.

here is a sample of the working python code file that does the conversion from IDLE.

I've also attached my converted UI file as well.

I know I'll need to check the radio buttons would it be best to do so in a loop?

Qt Code:
  1. def Fluid_converter():
  2.  
  3. while True:
  4. P1 = input("Convert to ML,OZ (select one), 'Q'=quit: ")
  5. print (P1)
  6.  
  7.  
  8. if P1.lower() == "ml":
  9. Volume = float(input("What is your Volume?"))
  10. answer = (Volume / 29.5735296)
  11.  
  12. print(round(answer, 4))
  13. elif P1.lower() == "oz":
  14. Volume = float(input("What is your Volume?"))
  15. answer = (Volume * 29.5735296)
  16. print(round(
To copy to clipboard, switch view to plain text mode 




ConverterUIpic.jpgfuchsuiv2.pyConverterUIpic.jpg