我该如何花时间将其发布并在不久后离开?

时间:2019-06-08 23:43:18

标签: python tkinter message

如何发送消息?因为我想在同一位置以不同的颜色显示更多消息,并且消息都结束了,所以导致了错误。

class Users:
    def __init__(self,window):
        #Criando o sistema
        self.wind = window
        self.wind.title("System F2T")

        self.msgR = Label(text="",fg="red")
        self.msgR.place(x=110,y=110)
        self.msgR.configure(background="black")
        self.msgY = Label(text="",fg="yellow")
        self.msgY.place(x=110,y=110)
        self.msgY.configure(background="black")

    def delete (self):
        self.msgY['text'] = ''
        try:
            self.tree.item(self.tree.selection())['text'][0]
        except IndexError as e:
            self.msgY['text'] = 'Por favor selecione um usuário!'
            return
        self.msgR['text'] = ''
        user = self.tree.item(self.tree.selection())['text']
        query = 'DELETE FROM users WHERE user = ?'
        self.run_query(query, (user, ))
        self.msgR['text'] = 'Usuário {} deletado com sucesso!'.format(user)

0 个答案:

没有答案