localhost@localhost:~$ vi b12.py
import subprocess, os
printer='HPLaserjet_1020'
pdffile='output.pdf'
cmd = 'lp -d %s %s' %(printer, pdffile)
os.system(cmd)
lpr =
subprocess.Popen("/usr/bin/lpr", stdin=subprocess.PIPE)
lpr.stdin.write("This is a testing
")
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"b12.py" 8 lines, 234 characters
localhost@localhost:~$ python b12.py
This is a testing
localhost@localhost:~$
No comments:
Post a Comment