58 lines
1.4 KiB
Python
58 lines
1.4 KiB
Python
|
from tkinter import *
|
||
|
from tkinter import messagebox
|
||
|
|
||
|
window = Tk()
|
||
|
window.minsize(width=600, height=600)
|
||
|
window.config(padx=50, pady=50)
|
||
|
window.title("Regresja")
|
||
|
|
||
|
|
||
|
tytul = Label()
|
||
|
tytul.config(text="Wycena wartości mieszkania na podstawie danych z serwisu otodom.pl", padx=70, pady=50)
|
||
|
tytul.grid(column=0, row=0, columnspan=2)
|
||
|
|
||
|
|
||
|
metraz = Label()
|
||
|
metraz.config(text="Metraż", pady=20)
|
||
|
metraz.grid(column=0, row=1)
|
||
|
|
||
|
metraz_entry = Entry()
|
||
|
metraz_entry.grid(column=0, row=2)
|
||
|
|
||
|
pietro_entry = Entry()
|
||
|
pietro_entry.grid(column=1, row=2)
|
||
|
|
||
|
|
||
|
pietro = Label()
|
||
|
pietro.config(text="Piętro", pady=20)
|
||
|
pietro.grid(column=1, row=1)
|
||
|
|
||
|
|
||
|
przewidywania = Label()
|
||
|
przewidywania.config(text="Przewidywanie:", pady=20, padx=5)
|
||
|
przewidywania.grid(column=0, row=4, sticky='e')
|
||
|
|
||
|
wartosc_regresji = Entry()
|
||
|
wartosc_regresji.insert(0, "CENA")
|
||
|
wartosc_regresji.grid(column=1, row=4, sticky='w')
|
||
|
|
||
|
|
||
|
|
||
|
def val_numbers():
|
||
|
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")
|
||
|
else:
|
||
|
confirm = messagebox.askyesno(title="Confirm", message="Do you want to start prediction?")
|
||
|
|
||
|
|
||
|
|
||
|
start_button = Button(command=val_numbers)
|
||
|
start_button.config(text="Start")
|
||
|
start_button.grid(column=0, row=3, columnspan=2, sticky="s", pady=20)
|
||
|
|
||
|
window.mainloop()
|
||
|
|
||
|
|