import tkinter as tk


def main():
    window= tk.Tk()
    window.title("ΕΚΑΤΟΣΤΑ to ΛΙΤΡΑ Converter")
    window.geometry("675x400")


    # block 1 - the first button
    
    # create a label with text Enter ΕΚΑΤΟΣΤΑ
    label1 = tk.Label(window, text="ΠΟΣΑ ΕΚΑΤΟΣΤΑ ΕΧΕΙΣ:")
    
    # create a label with text ΛΙΤΡΑ:
    label2 = tk.Label(window, text="ΕΧΕΙΣ ΛΙΤΡΑ:")

    # place label1 in window at position x,y 
    label1.place(x=50,y=30)

    # create an Entry widget (text box) 
    textbox1 = tk.Entry(window, width=12)

    # place textbox1 in window at position x,y 
    textbox1.place(x=200,y=35)

    # create an Entry widget (text box) 
    textbox2 = tk.Entry(window, width=12)

    # place label2 in window at position x,y 
    label2.place(x=50,y=100)
    
    # create a label3 with empty text:
    label3 = tk.Label(window, text=" ")

    # place label3 in window at position x,y 
    label3.place(x=180,y=100)

         
    def btn1_click():
        ΛΙΤΡΑ = round(float(textbox1.get()) * 10)
        label3.configure(text = str(ΛΙΤΡΑ)+ '  ΛΙΤΡΑ')
        

    # create a button with text Button 1
    btn1 = tk.Button(window, text="ΠΑΤΗΣΕ ΓΙΑ ΝΑ ΒΡΕΙΣ ΤΑ ΛΙΤΡΑ", command=btn1_click)
    # place this button in window at position x,y 
    btn1.place(x=90,y=150)
    window.mainloop()

# end of block 1 ================


    # block 2 -   the second button  
    
    # create a label with text Enter ΛΙΤΡΑ
    label4 = tk.Label(window, text="ΠΟΣΑ ΛΙΤΡΑ ΠΑΡΑΓΓΕΙΛΕΣ: ")
    
    # create a label with text ΛΙΤΡΑ:
    label5 = tk.Label(window, text="ΤΑ ΛΙΤΡΑ  ΑΥΤΑ ΕΙΝΑΙ  :")
    # place label2 in window at position x,y 
    label5.place(x=50,y=600)

    # place label1 in window at position x,y 
    label4.place(x=50,y=530)

    # create an Entry widget (text box) 
    textbox2 = tk.Entry(window, width=12)

    # place textbox1 in window at position x,y 
    textbox2.place(x=200,y=530)

    # create a label3 with empty text:
    label6 = tk.Label(window, text=" ")

    # place label3 in window at position x,y 
    label6.place(x=180,y=600)
             
    def btn2_click():
        ΛΙΤΡΑ = round(float(textbox2.get()) / 10)
        label6.configure(text = str(ΛΙΤΡΑ)+ '  ΕΚΑΤΟΣΤΑ')

    # create a button with text Button 2
    btn2 = tk.Button(window, text="ΠΑΤΗΣΕ ΓΙΑ ΝΑ ΒΡΕΙΣ ΤΑ ΕΚΑΤΟΣΤΑ", command=btn2_click)
    # place this button in window at position x,y 
    btn2.place(x=90,y=650)
    window.mainloop()
    
    main()


