0

I need to add a delay to part of a Python script, not the entire thing, but just a part.

5
  • 1
    What do you mean by delay? You want your script to just do nothing for a period of time? Commented Nov 15, 2015 at 2:28
  • 1
    Please show the code you wish to add a delay to. Commented Nov 15, 2015 at 2:29
  • 1
    Please provide more context: what are you trying to achieve and why do you believe that it requires a 'delay' ? Commented Nov 15, 2015 at 2:37
  • im now trying to add a proxy list for each login.. who can help with this Commented Nov 15, 2015 at 3:57
  • 1
    Please don't add things like edit : solved. import time time.sleep(timehere) to your questions: future readers will see the answer below for themselves. For more info on this topic please see How to Ask. Commented Nov 15, 2015 at 4:22

1 Answer 1

2

You can use time.sleep:

import time

time.sleep(1) # Sleeps for one second.

Note that generally you don't want a real delay, but you want one thing to happen before the other. Using a delay to emulate ordering is bad code, and will break.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.