Example

mail@pastecode.io avatar
unknown
python
3 years ago
492 B
2
Indexable
Never
#!/usr/bin/env python
#-*- coding: utf-8 -*-

import tkinter as tk

root = tk.Tk()

def trocar_cores():
    botao.configure(background = '#bfdecb')

botao = tk.Button(root, text='Pressione o Botão',
    command=lambda: trocar_cores())
botao.place(x = 155, y = 120)
botao.configure(background = '#9abfe3')

root.configure(background='#bfdecb')
root.title('Tkinter - colocando cores')
root.geometry('410x310')
root.resizable(False, False)
root.eval('tk::PlaceWindow . center')
root.mainloop()