How to make python script pause for sometime?

0 votes
Hi. I am running a python script and I am calling a function. But before calling the function, I want to make the program stop for a few seconds. How can I do that?
Apr 4, 2019 in Python by Raj
46 views

1 answer to this question.

0 votes

You can use the sleep method from the time module. Something like this:

import time
time.sleep(3)

This will pause the execution for 3 seconds.

answered Apr 4, 2019 by Hrishi

Related Questions In Python

0 votes
1 answer

How to write a python script for downloading a video from YouTube and saving it to a directory?

First download pytube using the following code  pip ...READ MORE

answered Sep 4, 2019 in Python by Neel
• 3,010 points
494 views
+2 votes
2 answers

How to make a laplacian pyramid using OpenCV python?

down voteacceptTheeThe problem is that you're iterating ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,740 points
1,839 views
0 votes
1 answer

how to exit a python script in an if statement

This works fine for me: while True: ...READ MORE

answered Sep 19, 2018 in Python by bug_seeker
• 15,390 points
7,484 views
0 votes
1 answer

In python how to test a string for a substring

if "ABCD" in "xxxxABCDyyyy": This can be used ...READ MORE

answered Oct 24, 2018 in Python by Priyaj
• 57,510 points
136 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 556 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

How to access different Anaconda environments from PyCharm for coding in Python?

Hi! In PyCharm, you can add any number ...READ MORE

answered Feb 11, 2019 in Python by Nymeria
• 3,520 points
253 views
0 votes
1 answer

How to get travis to fail if tests do not have enough coverage for python?

if you add the --fail-under switch to ...READ MORE

answered May 10, 2019 in Python by SDeb
• 13,230 points
128 views