How can I change my desktop background with python?(如何使用 python 更改我的桌面背景?)
问题描述
如何使用 python 更改我的桌面背景?
How can I change my desktop background with python?
我想在 Windows 和 Linux 上都这样做.
I want to do it in both Windows and Linux.
推荐答案
在python2.5或更高版本的Windows上,使用ctypes加载user32.dll并调用SystemParametersInfo()
与 SPI_SETDESKWALLPAPER 操作.
On Windows with python2.5 or higher, use ctypes to load user32.dll and call SystemParametersInfo()
with SPI_SETDESKWALLPAPER action.
例如:
这篇关于如何使用 python 更改我的桌面背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!