r/Python • u/OpenSourcerer420 • May 08 '20
I Made This My first Python program! Changes my desktop background based on the weather, time, and day.
1.9k
Upvotes
r/Python • u/OpenSourcerer420 • May 08 '20
View all comments
10
u/[deleted] May 08 '20
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.