我使用thispost中提供的解决方案从Python更改Windows桌面墙纸
这里是代码示例
import ctypes
import os
image_file = "myimage.jpg"
print("Setting the wallpaper")
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, os.path.abspath(image_file) , 0)
问题是这种改变是非持久性的,从某种意义上说,每当我重新启动电脑时,桌面墙纸都会被重置。我如何从Python持续更改Windows桌面墙纸?在
我使用python3.5
你应该这样称呼它
同时看看相关的documentation
相关问题 更多 >
编程相关推荐