Luk*_*ler 5 c python ctypes windows-7 python-3.x
所以我正在尝试使用ctypes模块创建一个Python 3.3程序来更改Windows桌面背景.我在Python 2.7中测试了以下代码,它运行得很好.但它只适用于Python 3.3!我正在使用Windows 7.这是代码:
import ctypes
SPI_SETDESKTOPWALLPAPER=20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKTOPWALLPAPER, 0,"C:/Users/Public/Pictures/Sample Pictures/Penguins.jpg", 3)
Run Code Online (Sandbox Code Playgroud)