I am trying to make a image my desktop image.
My Image path:
#Image Path
import random,os
folder= r"C:\\Users\rkp10\AppData\Local\Google\Chrome\User Data\Default\Extensions\laookkfknpbbblfpciffpaejjkokdgca\0.91.6_0\backgrounds"
a=random.choice(os.listdir(folder))
print(a)
Opening the image:
#Opening the Image
from PIL import Image
file = folder+'\\'+a
Image.open(file).show()
Making the image as my desktop image:
#Making the image as desktop image
import ctypes
image_path = file
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, image_path, 3)
Now the thing is the image path is found and it also opens an image.But instead of setting the opened image as desktop image, it just make my desktop image black.