How to return value of function out of mainloop in python? : In this code I want to retune value out of set function but I Cannot. 
what should i do?

    from tkinter import *
    temp= 0
    def sel():
       selection = "You selected the option " + str(var.get())
       label.config(text = selection)
       temp=selection
       return temp
    root = Tk()
    var = IntVar()
    R1 = Radiobutton(root, text="Option 1", variable=var, value=1,
                  command=sel)
    R1.pack( anchor = W )
    R2 = Radiobutton(root, text="Option 2", variable=var, value=2,
                  command=sel)
    R2.pack( anchor = W )
    R3 = Radiobutton(root, text="Option 3", variable=var, value=3,
                  command=sel)
    R3.pack( anchor = W)
    label = Label(root)
    label.pack()
    print (sel())
    root.mainloop()

why print function cann't show result?






