You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dc212b
Browse filesBrowse the repository at this point in the historyBrowse files
messagebox.showinfo(title="Remind", message="Please enter a number, not a string") # The contents of the input string, jump out of the prompt box
61
+
elifchoose==1: # If selected Kilometres to Miles
62
+
self.kiloToMiles(int(user_input_value))
63
+
elifchoose==2: # If selected Celsius to Fahrenheit
64
+
self.celsiusToFahrenheit(int(user_input_value))
65
+
elifchoose==3: # If selected Degrees to Radians
66
+
self.degreesToradians(int(user_input_value))
67
+
elifchoose==4: # If selected Centimeters to Inches
68
+
self.centimetersToinches(int(user_input_value))
69
+
else:
70
+
pass# Easy to expand
71
+
72
+
73
+
defmain(self):
74
+
self.var=IntVar() # Initialize options
75
+
remind_label=Label(self.mainwindows,text="Select the button to convert",font=("宋体",25)).pack()
76
+
KTM_btn=Radiobutton(self.mainwindows,text="Kilometres to Miles",variable=self.var,value=1,font=("宋体",15)).place(x=30,y=40) # Kilometres to Miles Button
77
+
CTF_btn=Radiobutton(self.mainwindows,text="Celsius to Fahrenheit",variable=self.var,value=2,font=("宋体",15)).place(x=30,y=70) # Celsius to Fahrenheit Button
78
+
DTR_btn=Radiobutton(self.mainwindows,text="Degrees to Radians",variable=self.var,value=3,font=("宋体",15)).place(x=350,y=40) # Degrees to Radians Button
79
+
CTI_btn=Radiobutton(self.mainwindows,text="Centimeters to Inches",variable=self.var,value=4,font=("宋体",15)).place(x=350,y=70) # Centimeters to Inches Button
80
+
Enter_label=Label(self.mainwindows,text="Enter Here: ",font=("宋体",20)).place(x=40,y=150) # Enter the prompt
81
+
self.Enter_Entry=Entry(self.mainwindows,font=("宋体",25)) # Enter the value of the conversion
82
+
self.Enter_Entry.place(x=220,y=150)
83
+
Entry_button=Button(self.mainwindows,text="Confirm the Calculation",font=("宋体",20),relief="solid",command=self.ConfirmtheCalculation).place(x=150,y=250) # Confirm the Calculation Button
84
+
self.return_value_Text=Text(self.mainwindows,width=34,height=4,font=("宋体",25),relief="solid") # The value after conversion is output here
0 commit comments