Issue / Question
Bidirectional communications programming example using Python
Issue Details
Python, bidirectional, ZPL, network, socket, programming
Applicable To
Developers seeking a programming example showing bidirectional communications
Resolution / Answer
import socket mysocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) host = "10.80.209.106" port = 9100 try: mysocket.connect((host, port)) #connecting to host mysocket.send(b"~hs")#using bytes data = mysocket.recv(1024) stringdata = data.decode('utf-8') print(stringdata) mysocket.close () #closing connection except: print("Error in connection")