整蛊人的小代码

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然后再按回车

  • 12
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
以下是一个HTML朋友的代码的示例: ```html <!DOCTYPE html> <html> <head> <title>朋友</title> <script> function pop(){ for(i=1; i<=20; i++){ window.open('#.htm','','width=800,height=600','status=off','location=off'); } } </script> </head> <body> <a href="#" onmouseover='pop()'>千万不要把鼠标放到这里!!!</a> </body> </html> ``` 这段代码会在鼠标悬停在链接上时弹出20个窗口,可能会让你的朋友感到惊讶或困惑。请注意,这只是一个示例代码,如果您想使用它,请自行修改适应您的需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [小学妹,督促学习的html代码](https://blog.csdn.net/weixin_44434883/article/details/117065451)[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: 50%"] - *2* *3* [5个拿来就能用的代码脚本](https://blog.csdn.net/wangyuxiang946/article/details/128311725)[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: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值