how to print to printer ?

Grant Edwards grante at visi.com
Fri Apr 12 13:29:37 EDT 2002


In article <a96q8o$9cd5d$1 at hades.rz.uni-sb.de>, Uwe Schmitt wrote:

> I'd like to send "raw" data to a printer, how can I do this,
> using Python ???

Under Unix:

  f = open("/dev/lp0")  # or whatever device is your printer 
  f.write(data)
  f.close()

I've no idea how to do it under Windows.

-- 
Grant Edwards                   grante             Yow!  I feel partially
                                  at               hydrogenated!
                               visi.com            



More information about the Python-list mailing list