#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    8
    Rep Power
    0

    how tos on printing from python


    I'm looking for how to's on printing from a python program. I want to out put data from my program to avery lables. Thanks for any help.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    If you're using a *nix like system then you could use the Python program to lay out the text and then pipe the output to the printer. This isn't a very a very Pythonic or portable solution but it is by far the easiest way I can think of .

    The only other way I can think of would be to use Mark Hammonds Win32 extensions assuming that Windows has an API for accessing the printer . It may also be possible to use the PySerial module to talk to the printer.

    http://starship.python.net/crew/mhammond/win32/
    http://pyserial.sourceforge.net/

    But I've never actually seen this done.

    Hope this is of some help,

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    8
    Rep Power
    0

    So maybe it's best to output to a text file?


    Maybe it's best to output to a text file then print?
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    If your not running *nix then that could be a good idea. If you are then it makes little difference which you choose . In fact on *nix I would probably go with printing the text to stdout.

    Mark.
    programming language development: www.netytan.com Hula

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    you could use some of the wxPython tools. I will try to find what i read, but it will let you print whatever. There was anouther one with wxPython that will work by turning something to html then printing witch is very easy also. i will look for it.

    Comments on this post

    • netytan agrees : Nice. Will be interesting to see :).
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    8
    Rep Power
    0

    Thanks for you help


    Actually I use linux, but It will eventually run I windows. If I can get good at this stuff. Thanks again for all the help.

IMN logo majestic logo threadwatch logo seochat tools logo