[Solved] TypeError: ‘str’ object is not callable 1


If the interpretation I gave in my comment is correct, one way to allow the user to call functions you define is to put those functions in a dictionary, keyed by their name. Then you can examine that dict to see if i belongs to it, and call the function if appropriate.

def buclick():
    i = ent.get()
    if i in user_callable_functions:
        user_callable_functions[i]()
    else:
        messagebox.showinfo("Error", "There is no product with this name")

#put this just above root.mainloop()
user_callable_functions = {
    "ic5501": ic5501,
    "ic5502": ic5502
}

2

solved TypeError: ‘str’ object is not callable 1