from tkinter import *
from tkinter import ttk
time_list = []
def time_set(x):
#main presets
root=Tk()
root.title('timer')
root.geometry('400x200+1515+850')
root.resizable(False, False)
#icon
icon=PhotoImage(file = "timer.png")
root.iconphoto(True, icon)
#fields for user time
entry_hour=ttk.Entry()
entry_minute=ttk.Entry()
entry_second=ttk.Entry()
entry_hour.pack()
entry_minute.pack()
entry_second.pack()
def close_window():
root.destroy()
def set():
global time_list
time_list = [entry_hour.get(), entry_minute.get(), entry_second.get()]
#button for preset
button_set = ttk.Button(text='Set', command=set)
button_set.pack(anchor=W)
#button for start
button_start=ttk.Button(text='Start',command=close_window)
button_start.pack(anchor=E)
root.mainloop()
time_set(True)
print(time_list)