Tkinter animation

Tkinter Text Animation 


from tkinter import *
import random
root = Tk() 

w=root.winfo_screenwidth()
h=root.winfo_screenheight()
root.resizable(False,False)
root.overrideredirect(True)
root.geometry(str(w)+"x"+str(h)+"+0+0")
root.config(bg='black')
color=['#FF3818','#FF5F20','#FF801D','#FFAB25','#FFCE1B','#FFFB1C','#CDFF28','#9BFF23','#60FF22','#2EFF1E','#25FF53','#32FF8D','#38FFC2','#2EFFF4','#30C8FF','#3597FF','#2D4BFF','#6735FF','#A834FF','#E735FF','#FF35DF','#FF3092','#FF2249','#FF1618']


speed=100

i=0
y_1=200

def ani():
global i,color,y_1,speed
x_1=random.randint(40,70)
label1.config(fg=color[i])
label1.place(x=x_1,y=y_1)
label1.after('5',ani)
if i <(len(color)-1):
i+=1
else:
i=0
if y_1<=600:
y_1+=speed
else:
y_1-=speed
label1 = Label(root,text='CODING VODING',font=('Arial',20,'bold'),bg='black') 
label1.place(x = 10, y = 10,height=500,width=1000) 
label1.config(fg='red')

ani()

root.mainloop()

Comments

Popular posts from this blog

Rock Paper Scissors

Remember matching game

Calendar