I'm writing a weather display program for my Raspberry Pi in python that fetches data using weather.com's api. As it stands, I have set it to sleep for 5 minutes after each main 'while' loop. This is because I don't want the Pi constantly using the wifi to fetch the same weather data. The problem with this is if I try to close or alter the program in any way, it waits to finish the time.sleep() function before continuing. I would like to add buttons to create a scroll menu but currently, the program will hang in that time.sleep() function before continuing. Is there an alternative I can use to delay the fetching of data while keeping program responsiveness?