easily immobilize PythonWin

Raseliarison nirinA nirina at mail.blueline.mg
Tue Jun 3 19:23:55 EDT 2003


"Kendear" wrote:

> How come the following code can so
> easily immobilize PythonWin?  (won't for IDLE)
> You can't go in the exec window and press CTRL-C
> 
> Also, the last printed statement is
> always not shown.
> 
> --
> 
> from time import sleep
> 
> while 1:
>      # do something
>      print
>      print "doing something"
> 
>      print "I am sleeping..."
>      sleep(3)
>      print "I just woke up"
> 
> 

you can flush it out! with the flush() method from sys module.

> --

from time import sleep
from sys import stdout

while 1:
     # do something
     print
     print "doing something"

     print "I am sleeping..."
     sleep(3)
     print "I just woke up"
     stdout.flush()

> --

nirinA
--













More information about the Python-list mailing list