简简单python装逼代码
时间: 2023-09-22 19:13:13 浏览: 104
以下是一个简单的Python装逼代码:
```python
import tkinter as tk
import random
import threading
import time
color = ['red', '#356F9F']
color1 = random.choices(color)
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('Python')
window.geometry("200x200" + " " + str(a) + " " + str(b))
tk.Label(window, text='病毒', bg=color1, font=('楷体', 17), width=15, height=10 ).pack()
window.mainloop()
threads = []
for i in range(1400):
t = threading.Thread(target=dow)
threads.append(t)
time.sleep(0.0000000000000000000001)
threads[i].start()
```
这段代码使用了Tkinter库创建了一个窗口,窗口的大小和位置是随机的。窗口的标题是'Python',窗口中有一个背景颜色随机的标签,标签上显示的文本是'病毒'。通过使用多线程,可以同时创建多个窗口,从而增加装逼的效果。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* *2* [Python装逼代码](https://blog.csdn.net/we123aaa4567/article/details/130274093)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]