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()
In questa pagina del sito puoi guardare il video online Python - tkinter animation - coding for all della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Jithesh Kuyyalil 08 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 527 volte e gli è piaciuto 6 spettatori. Buona visione!