Using sleep() to Code a Python Uptime Bot
Martin Breuss
22:30
Description
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. Adding Python sleep() calls to your program can help in each of these cases, and many more!
In this course, you’ll learn:
What You'll Learn?
- The basics of
time.sleep()
- How you can use
timeit
to measure your code’s execution time - How to use
time.sleep()
to build an uptime bot
More details
User Reviews
Rating
Martin Breuss
Instructor's CoursesAs someone who learned programming primarily through online resources, I feel that I have a good understanding of how important high quality learning material is.
With a background in education, I worked as a coding mentor, code reviewer, curriculum developer, and bootcamp instructor. Quality education and figuring out how to have fun while learning unfamiliar topics effectively has always been a big topic in my life. Real Python provides all that, and I’m happy that I can contribute.
In my day job I create online courses and teach on-site bootcamps around the world with CodingNomads. This position keeps me traveling, teaching, learning, discovering new places and new aspects of Python, as well as getting to know interesting and motivated students year-round.
When you learn to program, you’re learning to instruct a universal tool. People have described programming as the literacy of the 21st century, and I think that there’s something to that idea.
That doesn’t mean that you need to become a full-time software developer to apply your programming skills productively. Most likely there is way how your interests can benefit from being able to skillfully instruct your personal universal tool. And Python is a great language to get started with and also to keep going.
I’m happy to help out with thoughts and resources as well as encouragement.
If you’re stuck, remember that everyone gets stuck and if you feel you don’t know much, keep in mind that most of us feel that way quite often. Take a break, maybe go on a walk outside or do what it takes for you to keep yourself feeling good.
It’s easier to stick with something for the long term when you’re finding enjoyment in what you do. Remember that learning anything new is more of a marathon than a sprint. :)

Real Python
View courses Real Python- language english
- Training sessions 8
- duration 22:30
- Release Date 2023/01/05