I use the solution provided in this post to change the Windows desktop wallpaper from Python
In particular here is the code sample
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)
The problem is that the change is non persistent, in the sense that the desktop wallpaper gets reset whenever I restart my PC. How can I persistently change the Windows desktop wallpaper from Python?
I use python 3.5