時間:2023-07-06 18:06:01 | 來源:網(wǎng)站運(yùn)營
時間:2023-07-06 18:06:01 來源:網(wǎng)站運(yùn)營
用Python制作有趣的整蠱小程序:下面的整蠱程序,千萬不要發(fā)代碼,否則就實(shí)現(xiàn)不了你整蠱的目的了。完成后一定要打包成一個exe程序,再發(fā)給朋友使用 。 1. 使用 pip install pyinstaller pyinstaller -F 文件名.py
一、猜我在干啥? while True: n = input("猜猜我在想啥?") print("猜錯嘍")
啟動程序后你的朋友將永遠(yuǎn)猜不出來你在干嘛。'' 當(dāng)別人打開這個程序時,其電腦桌面會變成恐怖圖片,并播放恐怖音樂'''import timeimport pygameimport win32apiimport win32conimport win32gui#線程模塊import threadingdef go(): pygame.mixer.init() while True: for i in range(1,5): filePath = r"E:/pycharm project/自動化辦公和鼠標(biāo)鍵盤模擬/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/自動化辦公和鼠標(biāo)鍵盤模擬/p"+"//"+str(i)+".jpg" setWallpaper(filePath) time.sleep(4)
三、無線打開同一網(wǎng)站 import webbrowserwhile True: webbrowser.open('www.py.cn')
關(guān)鍵詞:程序,有趣
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。