On 2008-09-16, Graham Jenkins <gr****@vpac.orgwrote:
>
I'm trying to print a file from within a Python program.
The quick-and-dirty solution is to use something like:
fd = os.popen("lp -d MyPrinter", "wb")
fd.write(MyFileContents)
But it seems to me that there should be a clean solution like:
import cups
stat =
cups.Connection.printFile("MyFile","MyPrinter","My Title","MyOptions")
What about systems that don't use cups for printing?
--
Antoon Pardon 3 2430
On Sep 19, 9:01*am, Antoon Pardon <apar...@forel.vub.ac.bewrote:
On 2008-09-16, Graham Jenkins <gra...@vpac.orgwrote:
I'm trying to print a file from within a Python program.
The quick-and-dirty solution is to use something like:
fd = os.popen("lp -d MyPrinter", "wb")
fd.write(MyFileContents)
But it seems to me that there should be a clean solution like:
import cups
stat =
cups.Connection.printFile("MyFile","MyPrinter","My Title","MyOptions")
What about systems that don't use cups for printing?
--
Antoon Pardon
For Windows, there's a few different ways to print. Tim Golden has a
list on his website: http://timgolden.me.uk/python/win32_how_do_i/print.html
Mike
On 2008-09-26, Mike Driscoll <ky******@gmail.comwrote:
On Sep 19, 9:01*am, Antoon Pardon <apar...@forel.vub.ac.bewrote:
>On 2008-09-16, Graham Jenkins <gra...@vpac.orgwrote:
I'm trying to print a file from within a Python program.
The quick-and-dirty solution is to use something like:
fd = os.popen("lp -d MyPrinter", "wb")
fd.write(MyFileContents)
But it seems to me that there should be a clean solution like:
import cups
stat =
cups.Connection.printFile("MyFile","MyPrinter","My Title","MyOptions")
What about systems that don't use cups for printing?
-- Antoon Pardon
For Windows, there's a few different ways to print. Tim Golden has a
list on his website:
http://timgolden.me.uk/python/win32_how_do_i/print.html
I have a linux system that doesn't use cups for printing.
So his "clean" solution won't work on my box. Unless
of course his cups.Connection.printFile is just a wrapper
around os.popen("lp -d MyPrinter", "wb") or something
similar.
--
Antoon Pardon
Antoon Pardon wrote:
On 2008-09-26, Mike Driscoll <ky******@gmail.comwrote:
>On Sep 19, 9:01 am, Antoon Pardon <apar...@forel.vub.ac.bewrote:
>>On 2008-09-16, Graham Jenkins <gra...@vpac.orgwrote: I'm trying to print a file from within a Python program. The quick-and-dirty solution is to use something like: fd = os.popen("lp -d MyPrinter", "wb") fd.write(MyFileContents) But it seems to me that there should be a clean solution like: import cups stat = cups.Connection.printFile("MyFile","MyPrinter", "MyTitle","MyOptions") What about systems that don't use cups for printing?
-- Antoon Pardon
For Windows, there's a few different ways to print. Tim Golden has a list on his website:
http://timgolden.me.uk/python/win32_how_do_i/print.html
I have a linux system that doesn't use cups for printing.
So his "clean" solution won't work on my box. Unless
of course his cups.Connection.printFile is just a wrapper
around os.popen("lp -d MyPrinter", "wb") or something
similar.
Well I certainly don't pretend to offer any solutions on
my "Win32 How do I?" pages except for how to do things
on Win32 ;) .
TJG This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eduardo Hercos Rodrigues |
last post by:
Hi,
How to print directly from PHP code using CUPS?
Thanks,
"Eduardo Hercos Rodrigues"
|
by: G-Fit |
last post by:
Hello group,
I have several servers hosting SQL databases. On each of them, I have
several databases. All those databases have the same structure (even those
on different servers), only the data...
|
by: Mike Tammerman |
last post by:
Hi,
I want to get the printer list from CUPS. I found some ways using
lpstat -p and
http://localhost:631/printers
but, these ways require some parsing and I am not sure, if the parsing...
|
by: pradeep_TP |
last post by:
Hi all,
I have a few questions that I have been wanting to ask for long. These are
all related to ADO.net and specifically to conenction to database.
1) If I have opened a connection to a...
|
by: Chris Szabo |
last post by:
I've created a data access layer for a .NET web
application. I'm using C# and framework 1.1. I'm getting
an error from time to time when I close a connection
saying: ...
|
by: Rob Nicholson |
last post by:
We're getting an occasional occurrence of the following error when two users
try and open the same record in our ASP.NET app:
"There is already an open DataReader associated with this Connection...
|
by: Eric Sabine |
last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET
connection object, SQLConnection to be exact) and then I came across the
following in some microsoft code.
If Not cn Is Nothing...
|
by: freefly_xml |
last post by:
I am creating a pdf file with fop. When I open the PDF in Adobe reader
and print it the quality is much better than when I print the pdf
directly from Linux using the lp command.
Is there a way...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |