Feliz Ano 2023

from tkinter import *
root=Tk()
root.title("Contagem para o Ano Novo")
root.geometry("400x150")
root.resizable(False,False)
def start(t=10):
global i
i = 1
if i == 1:
cont.config(text=str(t), font=('Impact', 18))
if t > 0:
root.after(1000, start, t - 1)
else :
a = 'FELIZ ANO 2023'
cont.config(text=str(a), font=('Impact', 18))
cont = Label(text='', fg='#000000', bg='#C0C0C0', font=('Times', 18))
cont.place(relx=0.15,rely=0.2,relwidth=0.65,relheight=0.2)
butao = Button( text='START',fg='#000000', bg='#87CEFA', font=('arial', 12),command=start)
butao.place(relx=0.3,rely=0.6,relwidth=0.35,relheight=0.2)
root.mainloop()

 


import turtle
from random import randint, choice

largura = 700
altura = 500
S = turtle.Screen()
S.setup(largura, altura)
S.bgcolor('black')
S.title("Feliz Ano Novo")
colors = ['red', 'green', 'yellow', 'gold', 'pink', 'cyan', 'white', 'orange',
'violet', 'coral']
class Fireworks:
def __init__(self, radius):
self.T = turtle.Pen()
self.T.speed(0)
self.T.color(choice(colors))
self.T.hideturtle()
self.T.up()
self.T.setposition(randint(-250, 250), randint(0, 200))
self.T.down()
self.radius = radius
def update(self):
self.T.forward(self.radius)
self.T.backward(self.radius)
self.T.left(10)
def clean(self):
self.T.clear()
self.T.color(choice(colors))
self.T.up()
self.T.setposition(randint(-250, 250), randint(0, 200))
self.T.down()
T1 = Fireworks(randint(10, 100))
T2 = Fireworks(randint(10, 100))
T3 = Fireworks(randint(10, 100))
T4 = Fireworks(randint(10, 100))
T5 = Fireworks(randint(10, 100))
T = turtle.Pen()
T.sety(-150)
T.color('gold')
T.write('FELIZ ANO 2023!', align='center', font=(None, 50))
T.hideturtle()
while True:
for i in range(36):
T1.update()
T2.update()
T3.update()
T4.update()
T5.update()
T1.clean()
T2.clean()
T3.clean()
T4.clean()
T5.clean()
turtle.mainloop()

#Fonte: https://itescode.com/new-year-coding-in-python/


 


import turtle
screen = turtle.Screen()
screen.setup(width=1.0, height=1.0)
turtle.bgcolor('white')
tr = turtle.Turtle()
tr.speed("fastest")
tr.up()
# left decoration
for i in range(10):
for i in range(2):
tr.pensize(7)
tr.goto(-500, 0)
tr.down()
tr.color("purple")
tr.forward(100)
tr.circle(5, steps=4)
tr.right(60)
tr.color("violet")
tr.forward(50)
tr.right(120)
tr.right(30)
tr.up()
# right decoration
for i in range(10):
for i in range(2):
tr.pensize(7)
tr.goto(470, 0)
tr.down()
tr.color("red")
tr.forward(100)
tr.circle(5, steps=4)
tr.right(60)
tr.color("crimson")
tr.forward(50)
tr.right(120)
tr.right(30)
tr.up()
# top decoration
for i in range(10):
for i in range(2):
tr.pensize(7)
tr.goto(20, 265)
tr.down()
tr.color("forest green")
tr.forward(100)
tr.circle(5, steps=4)
tr.right(60)
tr.color("lime")
tr.forward(50)
tr.right(120)
tr.right(30)
tr.up()
# bottom decoration
for i in range(10):
for i in range(2):
tr.pensize(7)
tr.goto(20, -220)
tr.down()
tr.color("dark turquoise")
tr.forward(100)
tr.circle(5, steps=4)
tr.right(60)
tr.color("cyan")
tr.forward(50)
tr.right(120)
tr.right(30)


turtle.up()
turtle.color('red')
turtle.goto(-320, 40)
turtle.write("Feliz ", font=(None, 60))
turtle.goto(-60, 40)
turtle.color('deep pink')
turtle.write("Ano", font=(None, 60))
turtle.goto(145, 40)
turtle.color('blue')
turtle.write("Novo", font=(None, 60))
turtle.goto(-74, -60)
turtle.color('green')
turtle.write("2023!", font=(None, 60))
turtle.done()

# Fonte:https://copyassignment.com/wishing-happy-new-year-2023-in-python-turtle/


 

Comentários

Mensagens populares deste blogue

Criar Cartões de Visita

12 signos egípcios

Calcular a percentagem de ocupação