This code does that when you run it, there will be a app that will have 2 buttons. If you click one the "local files" one, the windows explorer will pop up. And now I want to know how to when you select a picture in the explorer, the programme will set it as your windows desktop background.
import tkinter as tk
from tkinter import filedialog, Text
import os
root = tk.Tk()
canvas = tk.Canvas(root, height=500, width=900)
canvas.pack()
def addImage():
slika = filedialog.askopenfile(initialdir="\n", title="Izberi sliko",
filetypes=(("JPEG", "*.jpeg"), ("PNG","*.png"), ("all files", "*.*")))
selectImage = tk.Button(root, text="Local image", padx=10, pady=5, fg="white", bg="#f6c1ff", command=addImage)
selectImage.pack()
ourLibrary = selectImage = tk.Button(root, text="WPManager library", padx=10, pady=5, fg="white", bg="#f6c1ff")
selectImage.pack()
root.mainloop()```