I'm trying to change the desktop background in my Windows 10 PC using a Python script but all I'm getting is a plain blue screen (default wallpaper I guess). Here is the code I'm using -
import ctypes
import os
pathToBmp = os.path.normpath("C:/Users/Siddharth/Wallpapers/a.bmp")
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, pathToBmp, 0)
The script works for my Windows XP system, but fails to do so in Windows 10. The path to BMP file is absolute, I've checked it multiple times during debugging, however I'm still getting a blue screen. Any fix?