How to print e.g. 0x00d3: 0x2559, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE regardless locale settings ???

Werner Schiendl ws-news at gmx.at
Tue Dec 18 12:36:42 CET 2001


Hi,

you must know the locale settings of your printer to print non-ASCII (i. e. ord > 127) characters on your printer (unless you have a unicode capable printer, which I do now know of one...).

Use the unicode object's encode() method with the proper encoding for the printer to get the right, encoded string.
When you send this to your printer, you'll get the desired result.

hth
Werner
  "Hrvoje Terček" <hrvoje.tercek at caatoosee.hr> wrote in message news:mailman.1008669442.10799.python-list at python.org...
  There is the problem:

  You have two attachments. Box.gif, box.txt. As you suppose the image
  is capture screen how file should appear and how it should look like on my
  dot-matrix printer, send from python !!! Box.txt is written in Notepad
  because there is only editor which accept my ALT+ commands exactly as I
  need.

              So task would be: If box.txt appeared exactly as box.gif look
  like, try load box.txt and push to printer all from python. Doesn't work at
  my place :(((

  Rephrase the problem ...

  in Python21\lib\encode there is the file cp437.py. Obviously used at installation and locale settings.

  Q: How to print (standard output or dot matrix printer) e.g. 0x00d3: 0x2559, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE regardless locale settings???

   

              I have Win2000, Python 2.1 and locale setting set to cp1250...



  Thanks at front

  Hrvoje Tercek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20011218/41235b49/attachment.html>


More information about the Python-list mailing list