About 222,000 results
Open links in new tab
  1. How to make a Python program wait? - GeeksforGeeks

    Apr 17, 2025 · How to make a Python program wait? The goal is to make a Python program pause or wait for a specified amount of time during its execution. For example, you might want to print a message, but only after a 3-second delay.

  2. python - How do I make a time delay? - Stack Overflow

    If you would like to put a time delay in a Python script: Use time.sleep or Event().wait like this:

  3. Python sleep(): How to Add Time Delays to Your Code

    In this tutorial, you'll learn how to add time delays to your Python programs. You'll use decorators and the built-in time module to add Python sleep() calls to your code. Then, you'll discover how time delays work with threads, asynchronous functions, and graphical user interfaces.

  4. How to Use wait() Function in Python? - Python Guides

    Jan 6, 2025 · Learn how to use the `wait()` function in Python with threading or event handling to pause execution. This guide covers syntax, examples, and applications.

  5. Python’s time.sleep() – Pause, Stop, Wait or Sleep your Python Code

    A look into Python's time.sleep() function - by letting you pause, wait, sleep, or stop your Code. We look at the syntax, an example and the accuracy.

  6. How to Wait for a Specific Time in Python? - AskPython

    May 18, 2020 · One possible approach to make a program wait for a specific time in Python is using the time module. We can use time.sleep(n) to wait for n seconds. Of course, we can make n to be decimal to be more precise with our interval! Here is a simple example, which schedules two function calls between 3 seconds within each other. return 2 * a. return a * a

  7. How To Add Time Delay In Your Python Code

    There are numerous ways to add a time delay and, in this article, we will discuss each method step-by-step. Python's time module has a handy function called sleep (). Essentially, as the name implies, it pauses your Python program. The time.sleep ()command is the equivalent to the Bash shell's sleep command.

  8. Make Python Program Wait - Stack Overflow

    Mar 18, 2013 · Use the time library and use the command time.sleep() to make it wait. It's more efficient when choosing to extract it from the time library and then use just sleep() For Example: import time print('hi') time.sleep(0.2) print('hello')

  9. The Python Sleep Function – How to Make Python Wait A Few …

    Aug 24, 2020 · You can use Python’s sleep() function to add a time delay to your code. This function is handy if you want to pause your code between API calls, for example. Or enhance the user’s experience by adding pauses between words or graphics. When I run the above code, there’s about a two-second delay before "hello world" prints.

  10. Python time.sleep(): Add Delay to Your Code (Example)

    Jan 25, 2024 · Its primary purpose is to suspend the execution of a program for a specified number of seconds, introducing a delay into the code. The general syntax of time.sleep() is as follows: seconds: The duration of the delay in seconds. It can be a floating-point number for sub-second precision. Output:

  11. Some results have been removed
Refresh