Feb-07-2021, 11:31 PM
(This post was last modified: Feb-07-2021, 11:31 PM by blakefindlay.)
I'd like my gui to have a different background based on the current hour and month. I've imported datetime. Its not returning any errors but returns the else statement.
second_now = datetime.datetime.now().second minute_now = datetime.datetime.now().minute hour_now = datetime.datetime.now().hour day_now = datetime.datetime.now().day month_now = datetime.datetime.now().month year_now = datetime.datetime.now().year if hour_now >= 7 <= 21 and month_now >= 5 <= 9: background = PhotoImage(file="C:\\Users\\blake\\PycharmProjects\\farming\\images\\farm_summer_day.png") background_label = Label(root, image=background) background_label.place(x=0, y=0, relwidth=1, relheight=1) else: print("")