Printing in a generic way - like the rest of Python

Ed Connell connell at noflashspam.net
Tue May 13 02:39:56 EDT 2003


"John Hall" <wweexxsseessssaa at telusplanet.net> wrote in message
news:laavbvch52ba93hg87cj3fkbccki8kvc2c at 4ax.com...
> On Mon, 12 May 2003 06:47:52 GMT, "Ed Connell"
> <connell at noflashspam.net> wrote:
>
> >How can I print a file in a generic way in both Widows and Linux?  I've
> >searched for the answer but have not found it.
>
> I assume you mean something more than basic ASCII text?
>

No, I mean something as simple as printing an ASCI text file. (I mean
sending the file to the system printer.)  My program ran just fine in Linux,
(I used system( 'lpr %s' % filename ) and it worked just fine.  Now I want
to make the same program run in MS-Windows, and wondered if there is some
generic way to send files to the printer as there are generic ways to delete
a file, say, and all sorts of other stuff.

If the answer is no, then my next question is, how do you print a file in
the Windows world.  I feel foolish asking, but for the life of me, can't
figure what to do.  I tried 'print filename' from a command prompt, but
things didn't happen.

By the way, I have an Epson 820, connected directly to the back of my
Windows machine.

Any and all help will be greatly appreciated.

Ed Connell





More information about the Python-list mailing list