From 6407d2b4efd42053a48d0c62112bac7d4d9f185a Mon Sep 17 00:00:00 2001 From: Piotr Date: Tue, 17 Oct 2023 18:04:34 +0200 Subject: [PATCH] =?UTF-8?q?Dodanie=20zabezpieczen=20na=20liczb=C4=99=20cyf?= =?UTF-8?q?r=20pi=C4=99ter=20oraz=20metra=C5=BCu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface.py b/interface.py index 4a94b7e..2683e6f 100644 --- a/interface.py +++ b/interface.py @@ -39,10 +39,14 @@ wartosc_regresji.grid(column=1, row=4, sticky='w') def val_numbers(): + max_metraz = 100000 + max_piętro = 100 metraz = metraz_entry.get() pietro = pietro_entry.get() if metraz == "" or not metraz.isdigit() or pietro=="" or not pietro.isdigit(): 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: confirm = messagebox.askyesno(title="Confirm", message="Do you want to start prediction?")