I have a question. I\'d like to send a continuous streams of byte to some host for certain amount of time (let\'s say 1 minute) using python.
Here is my code so far
It's easy to test the scope of killed:
killed
>>> import thread >>> killed = False >>> import time >>> def test(): ... while True: ... time.sleep(1) ... if killed: ... print 'Dead.' ... break ... >>> thread.start_new_thread(test, ()) 25479680 >>> time.sleep(3) >>> killed = True >>> Dead.