Using Python's sleep() to Create a Simple Uptime Bot

preview_player
Показать описание
Have you ever needed to make your Python program wait for something? You might use a Python sleep() call to simulate a delay in your program. Perhaps you need to wait for a file to upload or download, or for a graphic to load or be drawn to the screen. You might even need to pause between calls to a web API, or between queries to a database.

You will build a simple bot script that will check a website to determine if it is currently up. The course goes into refactoring and optimizing the code.

Рекомендации по теме
Комментарии
Автор

Your website is one of the resources I often refer to whenever I need to know more about something in Python. Great comprehensive articles there. Thanks for your contribution. Love your podcasts as well

Pythonology
Автор

How come your code stopped with keyboard interrupt when your except block does not have Exception in it???

azkaarkhatib
Автор

I are no fan of sleep at all. I want to create a program with a strict purpose: query an url and see if it is up. Then I schedule to run this program using a cronjob. Is more intuative for me at least.

letsdoitmariistyle
visit shbcf.ru