def runCommunications(): global receive_message global elapse communication = Communication() while True: start = time.time() if settings.on: try: experiences2 = communication.receive('') count = len(experiences2.timestamps) experiences2.append('server_experiences') receive_message = 'Received ' + str(count) except (ConnectionRefusedError, ConnectionResetError) as e: receive_message = e.strerror else: receive_message = '' time.sleep(.1) elapse = time.time() - start
#!/usr/bin/python3 from Communication import Communication from Experiences import Experiences import time communication = Communication() while True: experiences = communication.receive('') print(experiences) time.sleep(1)