下面的整蛊程序,千万不要发代码,否则就实现不了你整蛊的目的了。完成后一定要打包成一个exe程序,再发给朋友使用 。
1. 使用 pip install pyinstaller
2.打包命令:
pyinstaller -F 文件名.py
一、猜我在干啥?
while True: n = input("猜猜我在想啥?") print("猜错喽")
启动程序后你的朋友将永远猜不出来你在干嘛。
二、恐怖桌面
启动后电脑桌面会变成恐怖图片,并播放恐怖音乐
'' 当别人打开这个程序时,其电脑桌面会变成恐怖图片,并播放恐怖音乐 ''' import time import pygame import win32api import win32con import win32gui #线程模块 import threading def go(): pygame.mixer.init() while True: for i in range(1,5): filePath = r"E:\pycharm project\自动化办公和鼠标键盘模拟\p"+"\\"+str(i)+".mp3" track = pygame.mixer.music.load(filePath) pygame.mixer.music.play() time.sleep(30) pygame.mixer.music.stop() def setWallpaper(path): reg_key = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,"Control Panel\\Desktop",0,win32con.KEY_SET_VALUE) win32api.RegSetValueEx(reg_key, "WallpaperStyle", 0, win32con.REG_SZ, "2") win32gui.SystemParametersInfo(win32con.SPI_SETDESKWALLPAPER, path, win32con.SPIF_SENDWININICHANGE) th = threading.Thread(target=go,name="loopTread") th.start() while True: for i in range(1,5): filePath = r"E:\pycharm project\自动化办公和鼠标键盘模拟\p"+"\\"+str(i)+".jpg" setWallpaper(filePath) time.sleep(4)
三、打开同一网站
调用默认浏览器,打开 python学习网 ,让他爱上学习。
import webbrowserwhile True: webbrowser.open('www.py.cn')
(推荐操作系统:windows7系统、Python 3.9.1,DELL G3电脑。)
Copyright © 2019- ovod.cn 版权所有 湘ICP备2023023988号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务