def send_progress(socket, min, max, current): if socket: s = "p:min={},max={},current={}\n".format(min, max, current) try: r = socket.sendall(s) except: print ("Error sending progress information")