Linux: access directory with lpr

67 views Asked by At

I'm trying to print my text file with 'lpr' in linux Ubuntu

import os
import tempfile

s = 'mystring'
f = tempfile.mktemp('.txt')
open(f,'w').write(s)

os.system("lpr -P myprinter_name f")

but I get this error:

lpr: Error - unable to access "f" - No such file or directory

How can I create tempfile without getting this error

THANKS!!!

0

There are 0 answers