Python - tkinter animation - coding for all

Publicado el: 08 diciembre 2020
en el canal de: Jithesh Kuyyalil
527
6

https://jitheshkuyyalil.com



Animating tkinter label in Python.
Ref: Programming Python by Mark Lutz

Source Code

import random
from tkinter import *
fsize = 20
colors=('red', 'green', 'orange','grey', 'cyan', 'blue', 'violet')


def makePopUp():
pop=Toplevel()
lb=Label(pop, text='new popup')
color = fg=random.choice(colors)
lb.config(font=('aerial', fsize, 'italic'), fg=color)
lb.pack(fill=BOTH)
rootLabel.config(fg=color)

def changeColor():
rootLabel.config(fg=random.choice(colors))
win.after(100, changeColor)

def blowUp():
global fsize
fsize += 5
rootLabel.config(font=('arial', fsize, 'italic'))
win.after(250, blowUp)


win = Tk()
rootLabel = Label(win, text="Gui Animation")
rootLabel.config(font=('aerial', fsize, 'italic'), \
fg="#%02x%02x%02x" % (255, 0, 0), bg='papaya whip')
rootLabel.pack(side=TOP, expand=True, fill=BOTH)
Button(win, text='make popup', command=makePopUp).pack(fill=X)
Button(win, text='change color', command=changeColor).pack(fill=X)
Button(win, text='blow up', command=blowUp).pack(fill=X)
win.mainloop()


En esta página del sitio puede ver el video en línea Python - tkinter animation - coding for all de Duración hora minuto segunda en buena calidad , que subió el usuario Jithesh Kuyyalil 08 diciembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 527 veces y le gustó 6 a los espectadores. Disfruta viendo!