import tkinter as tk
import threading
import time
import random
# Function to simulate a system deletion effect
def simulate_system_deletion(text_widget, width):
# Set of characters to simulate code
code_chars = "01<>{}[]()#*+-=/qwertyuiopasdfghjkl"
# Fake dangerous operations in Chinese
fake_operations = [
"正在尝试访问根目录...",
"绕过安全协议...",
"删除系统文件...",
"注入恶意代码...",
"系统清除中...",
"操作完成。系统严重受损。"
]
# Tag configuration for fake operations (larger font)
text_widget.tag_configure("operation", font=('Consolas', 16, 'bold'), foreground="red")
# Simulate fake operations
for operation in fake_operations:
text_widget.insert(tk.END, operation + '\n', "operation")
text_widget.see(tk.END)
text_widget.update()
time.sleep(2) # Pause for each operation
# Print fake code lines rapidly
for _ in range(400): # Large number of lines for quick scrolling
fake_code_line = "".join(random.choice(code_chars) for _ in range(width))
text_widget.insert(tk.END, fake_code_line + '\n')
text_widget.see(tk.END) # Auto-scroll to the bottom
text_widget.update()
time.sleep(0.01) # Very short delay for fast scrolling
# Final message in Chinese
text_widget.insert(tk.END, "\n警告:系统严重受损\n", "operation")
text_widget.see(tk.END)
text_widget.update()
time.sleep(2)
text_widget.insert(tk.END, "\n开个玩笑!您的系统很安全。😊,按下q键,再按回车就可退出\n", "operation")
text_widget.see(tk.END)
text_widget.update()
def on_closing():
pass # Disable the closing button
def start_simulation(text_widget, width):
# Run the simulation in a separate thread to avoid freezing the GUI
threading.Thread(target=simulate_system_deletion, args=(text_widget, width), daemon=True).start()
def on_key_press(event, root):
if event.char == 'q':
root.destroy()
root = tk.Tk()
root.title("模拟系统警告")
# Get the width of the window for the code simulation
screen_width = root.winfo_screenwidth()
# Set the window to fullscreen and disable minimize and resize
root.attributes('-fullscreen', True)
root.attributes('-topmost', True) # Keep the window always on top
root.bind('<KeyPress>', lambda event: on_key_press(event, root))
root.protocol("WM_DELETE_WINDOW", on_closing)
# Create a text widget to display the simulated deletion operation
text_widget = tk.Text(root, bg='black', fg='green', font=('Consolas', 12), wrap='none')
text_widget.pack(expand=True, fill='both')
# Display the exit instruction
exit_instruction = "\n按 'q' 键退出程序"
text_widget.insert(tk.END, exit_instruction)
text_widget.update()
# Start the simulation
start_simulation(text_widget, screen_width)
# Run the application
root.mainloop()
将这个代码复制到运行环境中,运行后
都会直接出现一个强制最大化的窗口,并且这个也会强制在最上方,无法被其他窗口覆盖,它会提示你正在尝试访问系统根目录删除系统文件,在这其中无法关闭窗口任务管理器等都不起效,很适合整蛊你的好兄弟
要退出按q然后再按回车