猫史档案馆


【Python作品分享】电脑病毒【作品秀】

用户:浮躁的飓风雀HYKa浮躁的飓风雀HYKa查看:4 回复:4 评论:4 创建时间:2021-03-31T17:47:55


【作品展示】

center_image

 

【作品介绍】

效果:

锁定音量100%;播放天空之城;鼠标乱抖;弹出巨量恶搞窗口

(PS: 对电脑没有伤害)

 

【作品源代码】

import tkinter as tk
import tkinter.messagebox
from pynput import keyboard
import random
import os
import threading
import time
from winsound import Beep
from pynput.mouse import Button, Controller
mouse = Controller()
keyboardController = keyboard.Controller()


def po():
    while True:
        mouse.move(random.randint(-10, 10), random.randint(-10, 10))
        time.sleep(0.01)
        keyboardController.press(keyboard.Key.media_volume_up)


def sound():
    Beep(880, 250)
    Beep(988, 250)
    Beep(523*2, 600)
    Beep(988, 300)
    Beep(523*2, 600)
    Beep(659*2, 600)
    Beep(988, 1000)
    Beep(659, 250)
    Beep(659, 250)
    Beep(880, 600)
    Beep(784, 300)
    Beep(880, 600)
    Beep(523*2, 600)
    Beep(784, 1000)
    Beep(659, 600)
    Beep(698, 800)
    Beep(659, 300)
    Beep(698, 600)
    Beep(523*2, 600)
    Beep(659, 980)
    Beep(523*2, 250)
    Beep(523*2, 250)
    Beep(523*2, 250)
    Beep(988, 600)
    Beep(739, 300)
    Beep(739, 600)
    Beep(988, 600)
    Beep(988, 1000)
    Beep(880, 250)
    Beep(988, 250)
    Beep(523*2, 600)
    Beep(988, 300)
    Beep(523*2, 600)
    Beep(659*2, 600)
    Beep(988, 1000)
    Beep(659, 250)
    Beep(659, 250)
    Beep(880, 600)
    Beep(784, 300)
    Beep(880, 600)
    Beep(523*2, 600)
    Beep(784, 1000)
    Beep(659, 600)
    Beep(698, 800)
    Beep(659, 300)
    Beep(698, 600)
    Beep(523*2, 600)
    Beep(659, 980)
    Beep(523*2, 250)
    Beep(523*2, 250)
    Beep(523*2, 250)
    Beep(988, 600)
    Beep(739, 300)
    Beep(739, 600)
    Beep(988, 600)
    Beep(988, 1000)
    #天空之城


def autoBeep():
    while True:
        print(66)
        sound()


def dow(p):
    window = tk.Tk()
    width = window.winfo_screenwidth()-200
    height = window.winfo_screenheight()-75
    a = random.randrange(0, width)
    b = random.randrange(0, height)
    window.attributes("-toolwindow", True)
    window.attributes("-topmost", True)
    window.overrideredirect(True)
    window.attributes("-alpha", 0.7)
    window.title('')
    window.geometry("200x50"+"+"+str(a)+"+"+str(b))
    tk.Label(window,
             text='Error',    # 标签的文字
             bg=random.choice(['Red', 'yellow', 'blue', 'Cyan',
                               'Magenta', 'Green']),     # 背景颜色
             font=('黑体', 17),     # 字体和字体大小
             width=15, height=2,  # 标签长宽
             fg="fireBrick"
             ).pack()    # 固定窗口位置
    window.mainloop()


def tdow(p):
    window = tk.Tk()
    width = window.winfo_screenwidth()-200
    height = window.winfo_screenheight()-75
    a = random.randrange(0, width)
    b = random.randrange(0, height)
    window.attributes("-toolwindow", True)
    window.attributes("-topmost", True)
    window.title('error')
    window.geometry("200x50"+"+"+str(a)+"+"+str(b))
    tk.Label(window,
             text='电脑已驾崩',    # 标签的文字
             bg='fireBrick',     # 背景颜色
             font=('宋体', 17),     # 字体和字体大小
             width=15, height=2,  # 标签长宽
             fg="GhostWhite"
             ).pack()    # 固定窗口位置
    window.mainloop()


tss = threading.Thread(target=po)
ty = threading.Thread(target=autoBeep)
ty.start()
tss.start()
threadss = []
for i in range(random.randint(25, 35)):  # 需要的弹窗数量
    os.system('start')  # 用命令打开cmd窗口,制造喵扰弹窗
for i in range(random.randint(25, 35)):  # 需要的弹框数量
    t = threading.Thread(target=lambda: tdow(i))
    threadss.append(t)
    time.sleep(random.randint(1, 25)/100)
    threadss[i].start()
threads = []
for i in range(random.randint(25, 35)):  # 需要的弹框数量
    t = threading.Thread(target=lambda: dow(i))
    threads.append(t)
    time.sleep(random.randint(1, 25)/100)
    threads[i].start()

while True:
    tkinter.messagebox.showerror(title='错误', message='你以为呢?')

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
降魔大圣一魈降魔大圣一魈

你这,怎么退出呢

点赞0


评论


超级无敌编程大神超级无敌编程大神

简单嘛~~用任务管理器关闭海龟就可以了~~~

点赞0


评论


爱玩蛋仔的凤凰爱玩蛋仔的凤凰

怎么退出呢?????????????????????????

点赞0


评论


好童鞋好童鞋

求无限递归

死机的那种

点赞0


评论