Newbie Printing Question

Discussion in 'Python' started by Richard Lyons, Mar 28, 2005.

  1. I'm just starting to work with Python. Have had a little experience
    with basic. I am using Python on a Windows XP system.
    How to I print a line of output generated in a python script to a
    printer attached to the windows computer?
     
    Richard Lyons, Mar 28, 2005
    #1
    1. Advertisements

  2. Richard Lyons

    Larry Bates Guest

    If it is a print that can take direct character output (e.g. one
    that has PCL or text mode emulation) you can do following:

    lpr=open('LPT1','w') # or LPT2, LPT3
    lpr.writeline('the output line you want')
    lpr.close()

    If it is a GDI-only printer it is MUCH more difficult. You need
    to interface with Windows GDI. If this is the case, take a look
    at wxPython interface to wxWindows (see printPreview) or you can
    use Mark Hammonds Windows utilities.

    FYI, Larry


    Richard Lyons wrote:
    > I'm just starting to work with Python. Have had a little experience
    > with basic. I am using Python on a Windows XP system.
    > How to I print a line of output generated in a python script to a
    > printer attached to the windows computer?
     
    Larry Bates, Mar 28, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon B
    Replies:
    7
    Views:
    8,053
    =?Utf-8?B?SmFzb25DaG9p?=
    Jan 30, 2006
  2. Markis Landis Gardner
    Replies:
    6
    Views:
    4,678
    Andrew Thompson
    Dec 25, 2003
  3. JustSomeGuy
    Replies:
    13
    Views:
    732
    msalters
    Dec 9, 2004
  4. iffy agbim
    Replies:
    1
    Views:
    257
    Mark Andrews
    May 24, 2004
  5. iffy agbim
    Replies:
    0
    Views:
    373
    iffy agbim
    May 21, 2004
  6. Jerry C.
    Replies:
    8
    Views:
    586
    Uri Guttman
    Nov 23, 2003
  7. Amit
    Replies:
    0
    Views:
    403
  8. Dennis Lee Bieber

    Re: Newbie to python. Very newbie question

    Dennis Lee Bieber, Apr 7, 2013, in forum: Python
    Replies:
    1
    Views:
    158
    Miki Tebeka
    Apr 8, 2013
Loading...