?

Log in

No account? Create an account

Previous Entry | Next Entry

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 = "10.1.1.2"  # 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))
  s.send(send_message)
  s.close()

Comments

( 5 comments — Leave a comment )
pastilla
Oct. 17th, 2007 09:24 pm (UTC)
I bet halophoenix could create an awesome zen master copier.
dblume
Oct. 17th, 2007 09:46 pm (UTC)
That's an awesome idea!

I was porting the weather copier to my python script for our HP 4650, but now I'm going to do a haiku one! Whee!
metroid23
Oct. 17th, 2007 09:30 pm (UTC)
Haha, that's awesome. Nice to see some people have a sense of humor ;)
dblume
Oct. 17th, 2007 09:48 pm (UTC)
Yeah, I'm going nuts with my little script. This is seriously fun.
(Anonymous)
Oct. 22nd, 2007 09:46 pm (UTC)
Nice! i was thinking on porting this to python!

Thanks!
( 5 comments — Leave a comment )