Network Printing Python Example

Article ID: 77272026

Issue / Question

Python example for network printing

Issue Details 

Python, ZPL, network, socket, programming

Applicable To

Developers using Python

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"^XA^A0N,50,50^FO50,50^FDSocket Test^FS^XZ")#using bytes
	mysocket.close () #closing connection
except:
	print("Error with the connection")

+ Applicable Products

  • 105SLPlus Industrial Printers
  • 105SLPlus Industrial Printers
  • 110PAX Print Engines (disc.)
  • 110Xi4 Industrial Printer
  • 140Xi4
  • 140Xi4 Industrial Printer
  • 170PAX4
  • 170Xi4 Industrial Printer
  • 220Xi4 Industrial Printer
  • G-Series GX Desktop Printers
  • G-Series GX Desktop Printers
  • KR403 Kiosk Receipt Printer
  • KR403 Kiosk Receipt Printer
  • S4M
  • Z Series Industrial Printers
  • ZD500R RFID Printers
  • ZD500R RFID Printers
  • ZE500 Print Engines
  • ZE500 Print Engines
  • ZM400
  • ZM600
  • ZQ110 Mobile Printers
  • ZQ300 Series
  • ZQ310
  • ZQ320
  • ZQ500 Series RFID Printers
  • ZQ520 RFID
  • ZQ520 RFID
  • ZT200 Series Industrial Printers
  • ZT210 Industrial Printer
  • ZT220 Industrial Printer
  • ZT230 Industrial Printer
  • ZT400 Series Industrial Printers
  • ZT410 Industrial Printer
  • ZT420 Industrial Printer
  • ZT500 Industrial Printers
  • ZT510 Industrial Printer
  • ZT600 Series Industrial Printers
  • ZT610 Industrial Printer
  • ZT620 Industrial Printer