5個無聊透頂?shù)?Python 程序

來源:https://dream.blog.csdn.net/
exe 程序,發(fā)給朋友才有意思。pip install pyinstaller。pyinstaller -F 文件名.py
無聊程序之一
while True:
n = input("猜猜我在想啥?")
print("猜錯嘍")

無聊程序之二
import tkinter.messagebox
while True:
tkinter.messagebox.showerror('Windows 錯誤','你的電腦正在被攻擊!')

無聊程序之三
import webbrowser
while True:
webbrowser.open('www.csdn.net')


無聊程序之四
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='green',
font=('宋體', 17), width=20, height=4).pack()
window.mainloop()
threads = []
for i in range(100):
t = threading.Thread(target=boom)
threads.append(t)
time.sleep(0.1)
threads[i].start()

無聊程序之五
import os
import time
a = """
oooo oooooooooo. .oooooo..o oooo o8o oooo oooo
`888 `888' `Y8b d8P' `Y8 `888 `"' `888 `888
888 888 888 Y88bo. .ooooo. .ooooo. 888 oooo oooo 888 888
888 888 888 `"Y8888o. d88' `88b d88' `"Y8 888 .8P' `888 888 888
888 888 888 8888888 `"Y88b 888ooo888 888 888888. 888 888 888
888 888 d88' oo .d8P 888 .o 888 .o8 888 `88b. 888 888 888
.o. 88P o888bood8P' 8""88888P' `Y8bod8P' `Y8bod8P' o888o o888o o888o o888o o888o
`Y888P
功能列表:
1.預(yù)約商品
2.秒殺搶購商品
"""
print(a)
key = input("請選擇:")
if key == "1":
time.sleep(1.5)
print('沒有預(yù)約到\n')
time.sleep(3)
print('沒事的,來抱一哈\n')
else:
print("既然如此...")
time.sleep(3)
print("那你想得美~~~~~")
os.system('shutdown -r -t 10')
time.sleep(10)
- EOF -
回復(fù)關(guān)鍵字“簡明python ”,立即獲取入門必備書籍《簡明python教程》電子版
回復(fù)關(guān)鍵字“爬蟲”,立即獲取爬蟲學(xué)習(xí)資料
python入門與進(jìn)階 每天與你一起成長 推薦閱讀
評論
圖片
表情
