[Python] AttributeError: Messagebox can't take multiple attributes?

Discussão em 'Python' iniciado por Stack, Maio 1, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to add multiple attributes to a messagebox in my program:

    from Tkinter import *
    from Tkinter import messagebox as msgbox

    *some code...*

    input1 = msgbox.askyesno.showwarning('title', 'blahblahblah')
    if input1 == 1:
    input2 = msgbox.askyesno.showwarning('title', 'blahblahblah')
    if input2 == 1:
    function()


    But it shows me this error:

    input1 = msgbox.askyesno.showwarning('title', 'blahblahblah')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'function' object has no attribute 'showwarning'


    I tried changing the order of the attributes but it didn't help. Can anyone help???

    Continue reading...

Compartilhe esta Página