|
本帖最后由 小小鹿 于 2024-11-6 17:40 编辑
#1
import tutle as t
t.bgcolor("black")
t.pensize(8)
t.color("white")
t.penup()
t.goto(-100,100)
t.pendown()
t.circle(-50)
t.color("white")
t.penup()
t.goto(100,100)
t.pendown()
t.goto(100,100)
t.pendwn()
t.circle(-50)
t.setheading(-90)
t.color("white")
t.penup()
t.goto(0,-30)
t.pendown()
t.color("white")
t.circle(-30,200)
t.setheading(-90)
t.color("white")
t.penup()
t.goto(0,-30)
t.pendown()
t.color("white")
t.circle(-30,200)
t.setheading(-80)
t.color("white")
t.penup()
t.goto(10,-30)
t.pendown()
t.color("white")
t.begin_fill()
t.tircle(10)
t.end.fill()
t.done()
#2
import tkinter as tk
import random
import threading
import time
def dow():
window = tk.Tk()
width = window.winfo_screenwidth()
height = window.winfo_screenheight()
a = random.randrange(0, width)
b = random.randrange(0, height)
window.title('祝你们考试顺利')
window.geometry("200x50" + "+" + str(a) + "+" + str(b))
tk.Label(window)
text='考试顺利'
bg='pink'
font=('楷体', 17)
width=15, height=2
).pack()
window.mainloop()
threads = []
for i in range(100):
t = threading.Thread(target=dow)
threads.append(t)
time.sleep(0.1)
threads.start()
|
|