整蛊朋友的python代码{1}(二次创作)
死命彈窗
上代碼
?
import tkinter as tk
import random
import threading
import time
def boom():
? ? 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='blue',
? ? ? ? ? ? ?font=('宋體', 17), width=20, height=4).pack()
? ? window.mainloop()
threads = []
for i in range(99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999):
? ? t = threading.Thread(target=boom)
? ? threads.append(t)
? ? time.sleep(0.1)
? ? threads[i].start()
重點摘要解釋
1,單引號內的內容可編輯
2,bg='blue' 背景顏色設置
3,看到那么多9了嗎?是彈窗的個數!
總結
以上是生活随笔為你收集整理的整蛊朋友的python代码{1}(二次创作)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 9月股票行情如何?
- 下一篇: 开水果店需要准备什么,开水果店要准备什么