Printing from python on Windows platform

Johann Spies jhspies at futurenet.co.za
Tue Aug 3 17:26:00 EDT 1999


I am sorry to ask this a second time, but I did not receive any hint 
after the first time I put this question to the list. 

I am a Linux user writing a program for somebody that will use it on a
Windows platform.  In Linux I use the following to redirect printing to
the printer:

    drukker = sys.stdout
    drukker = os.popen('lpr','w')
    drukker.write(drukstuk)
    sys.stdout.write(drukstuk)

What would the windows equivalent be?

I have tried os.popen('prn', 'w'), but without success.  I cannot see
anything in the python documentation to help me. 


Johann

 --------------------------------------------------------------------------
| Johann Spies                                 Windsorlaan 19              |
| jhspies at futurenet.co.za                3201 Pietermaritzburg             |
| Tel/Faks Nr. +27 331-46-1310		       Suid-Afrika (South Africa)  |
 --------------------------------------------------------------------------

     "Have not I commanded thee? Be strong and of a good 
      courage; be not afraid, neither be thou dismayed; for 
      the LORD thy God is with thee whithersoever thou 
      goest."                        Joshua 1:9 







More information about the Python-list mailing list