I added the print line (keeping the indentation same as the subprocess line) and changed lp to lpr in line 132, but no change in the error message. Just for clarity, that section now looks like this:
and the error when I try to print still looks like this: