目录
不想上班
杂乱的内心独白
杂乱的内心独白与代码
结语
不想上班
一想到要返工就有点emo的你
并不是孤身一人
我这一生,如履薄冰,新的一天,从不想上班开始。
杂乱的内心独白
我杂乱的内心啊
杂乱的内心独白与代码
import tkinter as tk
from PIL import Image, ImageTk
import random
import tkinter as tk
from tkinter import messagebox
import random
def create_final_window():
window1 = tk.Tk()
window1.title("不想上班")
window1.geometry("400x200")
colors = ['#FFC0CB', '#FFD700', '#ADD8E6', '#90EE90', '#FFB6C1']
bg_color = random.choice(colors)
window1.configure(bg=bg_color)
label1 = tk.Label(window1, text="今天真的", font=("Arial", 16, 'bold'), bg=bg_color)
label1.pack()
label2 = tk.Label(window1, text="不想上班!!!", font=("Comic Sans MS", 24, 'italic'), fg='red', bg=bg_color)
label2.pack()
def on_button_click():
messagebox.showinfo("加油!", "但是我们还是要努力工作哦!")
window1.quit()
window1.destroy()
tk._exit()
button = tk.Button(window1, text="点我!", command=on_button_click)
button.pack(pady=10)
window1.mainloop()
def create_window(image_path):
img = Image.open(image_path)
window = tk.Toplevel()
window.title("Image Viewer")
fixed_width = 300
fixed_height = 300
img_width, img_height = img.size
scale_width = fixed_width / img_width
scale_height = fixed_height / img_height
scale_factor = min(scale_width, scale_height)
img = img.resize((int(img_width * scale_factor), int(img_height * scale_factor)), Image.ANTIALIAS)
photo = ImageTk.PhotoImage(img)
label = tk.Label(window, image=photo)
label.image = photo
label.pack(expand=True)
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
x = random.randint(0, screen_width - fixed_width)
y = random.randint(0, screen_height - fixed_height)
window.geometry(f"{fixed_width}x{fixed_height}+{x}+{y}")
main_window = tk.Tk()
main_window.title("Main Window")
main_window.withdraw()
create_window("D:\\桌面\\python项目\\开工第一天\\1.png")
main_window.after(3000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\2.png"))
main_window.after(4000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\3.png"))
main_window.after(5000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\4.png"))
main_window.after(6000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\5.png"))
main_window.after(7000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\6.png"))
main_window.after(8000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(9000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\8.png"))
main_window.after(10000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\9.png"))
main_window.after(11000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\10.png"))
main_window.after(12000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\11.png"))
main_window.after(13000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\12.png"))
main_window.after(14000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\13.png"))
main_window.after(15000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\14.png"))
main_window.after(16000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\15.png"))
main_window.after(17000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\16.png"))
main_window.after(18000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\17.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(19000, lambda: create_window("D:\\桌面\\python项目\\开工第一天\\7.png"))
main_window.after(21000 , create_final_window)
main_window.mainloop()
结语
距离下次放假还要多久,,,快告诉我。。