I'm trying to automate some of our printing. The command has been issued from PowerShell or cmd.exe shell correctly. Below I have PowerShell version then cmd.exe version.
lpr -S '192.168.8.200' -Pfiletype=RPS -ol "C:\Users\rburnside\Desktop\Print Test\Hello 2020.09.23.ps"
lpr -S 192.168.8.200 -Pfiletype=RPS -ol "C:\Users\rburnside\Desktop\Print Test\Hello 2020.09.23.ps"
When I try to run it via Python 3 it returns an error code 1. I've tinkered with this for about 3 hours. I've tried using the system(command) function but I'm not sure which shell it uses? I assume cmd.exe. I've verified the command for both PowerShell and cmd.exe is correct and tried both.
Here is my Python attempt:
system("lpr -S '192.168.8.200' -Pfiletype=RPS -ol \"C:\\Users\\rburnside\\Desktop\\Print Test\\Hello 2020.09.23.ps\"")
I've also tried:
system("lpr -S 192.168.8.200 -Pfiletype=RPS -ol \"C:\\Users\\rburnside\\Desktop\\Print Test\\Hello 2020.09.23.ps\"")
I'm at a loss here...
Thanks for your help.