David (dblume) wrote,

HP Printer Ready Message "INSERT COIN"

Courtesy of our local HP printers and this awesome tip, I present today's python script:
from socket import *
import sys

printer = ""  # Change this to the IP of your printers
msg = "INSERT COIN"   # Or, AYBABTU for longer displays

if __name__=='__main__':
  if len(sys.argv) == 3:
    printer = sys.argv[1]
    msg = sys.argv[2]
  s = socket(AF_INET, SOCK_STREAM)
  send_message = \
    '\x1b%%-12345X@PJL JOB\n@PJL RDYMSG DISPLAY="%s"\n@PJL EOJ\n\x1b%%-12345X' % (msg, )
  s.connect((printer, 9100))
Tags: code, programming, python

  • Holiday and Birthday Loot

    Here's a sampling of the loot I got over the holidays. (My birthday occurs just after Christmas.) I can't tell you how much I love that my family…

  • ComicCon '09 Report

    Overview: Sightings/Meetings: Mike Mignola, Camilla D'Errica, David Mack, The Penny Arcade Duo, Josh Howard Far Away Sightings: Peter Jackson,…

  • ComicCon Schedule

    There's no telling how my ComicCon day will actually go down this year. Popular rooms fill up, and squatting through multiple sessions is allowed.…

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded