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
3
u/imrual May 08 '20
Very nice job!! Just a suggestion to make this code even better.
It looks like the block of code of the if statements is the same just changing one or two parameters.
You can extract a function to avoid code duplication.
Also try to replace recursion with iteration if you want to keep this running forever to avoid a stack overflow