Dodanie kodu interfejsu

This commit is contained in:
Zofia Zientek 2023-10-17 17:28:03 +02:00 committed by Zofia Zientek
parent c512fc9977
commit 4b13ee4b95

67
ceny_mieszkan.py Normal file
View File

@ -0,0 +1,67 @@
import tkinter.filedialog as filedialog
import tkinter as tk
master = tk.Tk()
header_text = "Ceny mieszkań"
header_label = tk.Label(master, text=header_text, font=("Arial", 25), anchor = "center", justify="center")
header_label.pack(fill="both", expand=True, padx=20, pady=20)
def output():
path = tk.filedialog.askopenfilename()
input_entry.delete(1, tk.END)
input_entry.insert(0, path)
top_frame = tk.Frame(master)
middle_frame = tk.Frame(master)
bottom_frame = tk.Frame(master)
line = tk.Frame(master, height=1, width=400, bg="grey80", relief='groove')
input_path = tk.Label(top_frame, text="Powierzchnia w m2:")
input_entry = tk.Entry(top_frame, text="", width=40)
input_path2 = tk.Label(middle_frame, text="Liczba pokoi:")
input_entry2 = tk.Entry(middle_frame, text="", width=40)
input_path3 = tk.Label(middle_frame, text="Czynsz:")
input_entry3 = tk.Entry(middle_frame, text="", width=40)
input_path4 = tk.Label(middle_frame, text="Rynek:")
input_entry4= tk.Entry(middle_frame, text="", width=40)
input_path5 = tk.Label(middle_frame, text="Stan:")
input_entry5= tk.Entry(middle_frame, text="", width=40)
begin_button = tk.Button(bottom_frame, text='Oblicz')
output_path = tk.Label(bottom_frame, text="Prognozowana cena:")
output_entry = tk.Entry(bottom_frame, text="", width=40)
line.pack(pady=4)
top_frame.pack(side=tk.TOP)
bottom_frame.pack(side=tk.BOTTOM)
middle_frame.pack(side=tk.TOP)
input_path.pack(pady=5)
input_entry.pack(pady=5)
input_path2.pack(pady=5)
input_entry2.pack(pady=5)
input_path3.pack(pady=5)
input_entry3.pack(pady=5)
input_path4.pack(pady=5)
input_entry4.pack(pady=5)
input_path5.pack(pady=5)
input_entry5.pack(pady=5)
output_path.pack(pady=5)
output_entry.pack(pady=5)
begin_button.pack(pady=30, fill=tk.X)
master.mainloop()