views:

108

answers:

1

I have a Python 3 script that is going to be doing some regex substitution on some Rich Text Files (rtf) and I would like to be able to print out a whole directory's files on Windows, Linux, and Mac. I have done quite a bit of searching to no avail.

Thanks in advance.

+1  A: 

There is no cross-platform way. On Linux and OS X you can invoke lpr(1) via subprocess and CUPS will handle the document conversion as best as possible, but Windows is trickier.

Ignacio Vazquez-Abrams
So, I suppose I will have to detect the OS first and then call a section of code to deal with which one it is?
Magwich
Or just import modules called "winprint" or "posixprint" as "print" depending.
Ignacio Vazquez-Abrams
Well, not "print", but you get the picture.
Ignacio Vazquez-Abrams