#!/usr/bin/env python """docstring""" import socket import time __author__ = 'Peter McKinney' __date__ = '14/01/14' __copyright__ = 'Copyright 2013, Peter McKinney' __license__ = "FreeBSD" __maintainer__ = 'Peter McKinney' __email__ = 'peter.mckinney21@gmail.com' __status_ = 'Prototype' HOST = "SERVERS HOST" PORT = 7286 # The same port as used by the server while 1: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.send('[TIME]') data = s.recv(1024) s.close() print 'Received', repr(data) except Exception as e: print 'Connection Error' pass time.sleep(0.5)