-4

I've just made a program, but I want to make a function in one place just to wait a few seconds to continue working. Could you tell me how does that function look?

for example

print 'I know'
(HERE wait few seconds to continue working)
print 'I am so layman with my trivial question'
Tim
  • 41,901
  • 18
  • 127
  • 145
nilowz
  • 1
  • 1

1 Answers1

0
import time

print 'I know'
time.sleep(1) #number of seconds to wait
print 'I am so layman with my trivial question'

Documentation

Joren
  • 3,068
  • 25
  • 44
  • You chose to answer a no-research question. That's your prerogative, but don't you think you should refrain from keeping derogatory references in your post then? – Frédéric Hamidi May 14 '14 at 20:01
  • @FrédéricHamidi I don't see a derogatory reference? He copied OP's code and placed `time.sleep` in the slot it's supposed to go in. – Adam Smith May 14 '14 at 20:03
  • 1
    @Adam, yes, I actually hesitated a little, but I've made up my mind. This answer objectively reads derogatory to the questioner, even though the code comes from the question itself. Since Joren has decided to answer the question, I believe replacing that text would have been more courteous (even with something like "Now you know" and "It did not take long" ;) – Frédéric Hamidi May 14 '14 at 20:06
  • 2
    @FrédéricHamidi Fair enough. Frankly I think the failure here is choosing to answer the question instead of (presumably instead of, at least) closing it. I don't mind the carbon copy of the asker's code, even if it was originally self-flagellating. – Adam Smith May 14 '14 at 20:08