I am new to python and have a task to take input from a listbox and create radiobuttons for each entry. In my code I am able to create the radio buttons but they don't function when I click on them i.e. in this case they don't print "hello" and the number i. Here's the code:
def generateGraph():
    w = Toplevel(bg = "grey")
    w.resizable(0,0)
    frameData = Frame(w, bg="grey", padx=10, pady=10)
    frameData.grid(row = 0, column=0, pady = 1, padx = 1, sticky = N+E+S+W)
    InputLabel = Label(frameData, text="Inputs:", bg="grey")
    InputLabel.grid(row=1, column=0, padx=10, sticky=N+E+S+W)
    OutputLabel = Label(frameData, text="Outputs:", bg="grey")
    OutputLabel.grid(row=1, column=1, padx=10, sticky=N+E+S+W)
    i=0
    c=[]
    inputVar = IntVar()
    while(InputBox.get(i)):
        c.append(Radiobutton(frameData, text=InputBox.get(i), variable=inputVar, value = i, background="grey", command= hello(i)))
        c[i].grid(row = i+2, column = 0, sticky = W)
        i=i+1
    if makemodal:
        w.focus_set()
        w.grab_set()
        w.wait_window()
def hello(i):
    print("hello %d" %i)
Please help and thanks in advance.
 
     
    