Running lpr on windows from python

loial jldunn2000 at gmail.com
Wed Apr 20 09:57:11 EDT 2016


I am trying to run lpr from python 2.7.10 on windows

However I always get the error
'C:/windows/system32/lpr.exe ' is not recognized as an internal or external command,
operable program or batch file.

Even though typing the same at the  command prompt works OK


Any ideas?

I am using subprocess as follows

process = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

where command line is
C:/windows/system32/lpr.exe -S 172.28.84.38 -P RAW C:/john/myfile



More information about the Python-list mailing list