Dodanie zabezpieczen na liczbę cyfr pięter oraz metrażu

This commit is contained in:
Piotr 2023-10-17 18:04:34 +02:00
parent cb3ce74c98
commit 6407d2b4ef

View File

@ -39,10 +39,14 @@ wartosc_regresji.grid(column=1, row=4, sticky='w')
def val_numbers(): def val_numbers():
max_metraz = 100000
max_piętro = 100
metraz = metraz_entry.get() metraz = metraz_entry.get()
pietro = pietro_entry.get() pietro = pietro_entry.get()
if metraz == "" or not metraz.isdigit() or pietro=="" or not pietro.isdigit(): if metraz == "" or not metraz.isdigit() or pietro=="" or not pietro.isdigit():
messagebox.showinfo(title="Error", message=f"Please provide valid data") messagebox.showinfo(title="Error", message=f"Please provide valid data")
elif int(metraz) < 0 or int(metraz) > max_metraz or int(pietro) < 0 or int(pietro) > max_piętro:
messagebox.showinfo(title="Error", message=f"Please provide numbers between 0 to 100 for floors and 0 to 100.000 for metric area.")
else: else:
confirm = messagebox.askyesno(title="Confirm", message="Do you want to start prediction?") confirm = messagebox.askyesno(title="Confirm", message="Do you want to start prediction?")