Searching for an OS independing method for line printing
Randall Hopper
aa8vb at yahoo.com
Fri Mar 3 11:37:14 EST 2000
Dipl. Ing Axel Köhler:
|I'm looking for a module to have system independent print access to a
|lineprinter.
...
|It should not be to difficult too write a module that find out on which OS
|my program is runing and choose the right way to access. So I hope that
|somebody of you has done it before.
Well, when you say system-independent, that makes it more of a challenge:
MSWin: Maybe MSWin provides an abstract API to print to a printer.
But what if there are multiple printers? MSWin progs usually have a
Printer Setup... so the user can set this, among other things (page
parms, orientation, etc.)
UNIX: Is this system using lp? Or lpr? Or ... Assuming we knew, then
the question is which printer (printer queue) does the user want to
use? We might assume the user has already set $PRINTER or $LPDEST as
a preference, but maybe that printer only groks Postscript and we want
to print plain text. Or vice versa.
DOS: How do you know which parallel port has a printer on it, if any?
Maybe none do? Maybe multiple? You could just exec PRINT and take
your chances, but... And you don't know what preamble control strings
might be required. For example, some printers are set to expect UNIX
EOL convention, and some aren't.
For now, it might be best to take your queues off cross-platform apps like
Netscape and let the user configure the command used to print. The
print-to-file option is nice too and useful on occasion.
--
Randall Hopper
aa8vb at yahoo.com
More information about the Python-list
mailing list