def message_recieve(): global alive global master while True: if master == 'False': alive = 'False' alive = broadcast.recieve() print alive time.sleep(1)
import broadcast import struct import sys while True: print >>sys.stderr, '\nwaiting to receive message' data = broadcast.recieve(); print >>sys.stderr, 'received %s' % (data)
def message_recieve(master, alive): while True: if master.value == 0: alive.value = 0 alive.value = int(broadcast.recieve()) time.sleep(1)