#
# Learn To Computer 2009
# http://learntocomputer.blogspot.com/
#
# hpsetdisp.py
#
# The famous April Fools Day joke for HP printers with a
# character LCD. Change the printer_ip and display_msg
# to suit your needs.
#
# Keep in mind the characters per line for your display.
#
import sys
import socket
printer_ip = '192.168.0.101'
display_msg = 'REPLACE FLUX CAPACITOR'
b = ''
b = b + '\x1b%%-12345X@PJL JOB\n'
b = b + ('@PJL RDYMSG DISPLAY="%s"\n' % display_msg)
b = b + '@PJL EOJ\n\x1b%%-12345X'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((printer_ip, 9100))
s.send(b)
s.close()
Don't bring your printer to the public swimming pool.

Shameless self promotion.
