[Python] Tkinter colorchooser runs without even importing it

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    from tkinter import Button, Tk

    root = Tk()
    root.title("Tkinter window")

    def c():
    print("Yay")
    # a = colorchooser.askcolor()
    # l = Label(root, text = a[1], bg = a[1])
    # l.pack(pady = 10)
    # root.configure(bg = a[1])

    btn = Button(root, text = "Pick a colour", command = c)
    btn.pack()

    root.mainloop()


    Somehow this outputs this: Output

    I dont understand what is happening because I'm not even importing colorchoose from tkinter.

    Note: I did install tkcolorpicker a seperate package but uninstalled that straight after this strange error and cleared my pip cache.

    Continue reading...

Compartilhe esta Página