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. Advertising

  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. Advertising

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:
    7,482
    =?Utf-8?B?SmFzb25DaG9p?=
    Jan 30, 2006
  2. JustSomeGuy
    Replies:
    13
    Views:
    502
    msalters
    Dec 9, 2004
  3. iffy agbim
    Replies:
    1
    Views:
    97
    Mark Andrews
    May 24, 2004
  4. iffy agbim
    Replies:
    0
    Views:
    97
    iffy agbim
    May 21, 2004
Loading...

Share This Page