print before sleep in python

A

Avik Ghose

Hi All,
What I am trying to acheive is very simple. I want to print something
to the screen(sys.stdout) and then go to sleep (time.sleep) for a some
duration. Now, I want the thread to print the message first and then
go to sleep. But what actually happens is that it prints after coming
back to ready state. I have tried to flush the stdout
(sys.stdout.flush) but it did not work. I hope many of you will be
able to help me out. Thanks a lot in advance.
Regards,
Avik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,937
Members
47,481
Latest member
ElviraDoug

Latest Threads

Top