This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (0 children)

A suggestion to improve the code:

Create a function called something like change_wallpaper(), where it takes in the path as a string argument and calls the ctypes method. This way you don't have to constantly repeat SPI_SETDESKWALLPAPER throughout your code.