[Tutor] Printing to a parallel port
Chad Crabtree
flaxeater at yahoo.com
Thu Sep 23 06:34:14 CEST 2004
Jacob S. wrote:
> Hi,
>
> I'm an intermediate python prgrammer -- I do things like
command
> apps for simple tasks like creatings zip files, copying files,
> computing things like area, etc. Also, I have used VPython to
create a
> function graphing program, etc. Ugh, enough about me ---- I would
> like to know if there is a way in Python to send a string to a
printer
> on a parallel port or usb port. I do have one idea, but it's messy.
>
> Ex. --
>
> import os
>
> ask = raw_input('What string do you want to print? ')
> filetoprint = open( 'Temp.txt ' ,'w' )
> filetoprint.write( ask )
> filetoprint.close()
> batch = open( 'print.bat','w' )
> batch.write( 'Temp.txt > LPT1' )
> batch.close()
> os.startfile( 'print.bat' )
> os.remove( 'Temp.txt' )
> os.remove( 'print.bat' )
>
> ## End example
>
Well I saw this earlier on this list here's the link
http://aspn.activestate.com/ASPN/Mail/Message/2070242
I looked a little further into it but was unable to find much more
information.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
More information about the Tutor
mailing list