0
votes

What I have

  1. Printer internal IP
  2. ZPL code on printer
  3. parameters to plug into ZPL code

Is there a way to define a label and send it to the printer via Python? I would need to specify which label type to use on the printer since it can have multiple .zpl label codes stored on it.

are there dedicated libraries? Otehrwise what are some basic socket functions to get me started

1

1 Answers

2
votes

OK I am not a python expert here but the general process is:

  1. Open a TCP connection to port 9100

  2. Write ZPL to your connection

  3. Close your connection

You will want to look at the ^DF and ^XF commands in the ZPL programming guide to make sure you are using the templates right, but it is a pretty simple process.

If you are concerned about whether or not the printer is ready to print you could look at the ~hs command to get the current status.

In the end there is a C# and Java SDK available for the printer which has helper functions to push variables store in Maps to a template, but the JNI calls are probably more involved than just opening a TCP connection...