Friday, November 13, 2015

Implement a program for remote print manager to print documents on remote printer. (IP based printer) using Python

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

Perform a suitable assignment using Xen Hypervisor or equivalent open source to configure it. Give necessary GUI.

 To install kvm on Fedora:  yum install kvm  yum install virt-manager libvirt libvirt-python python-virtinst  su -c "yum install @v...