473,780 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printer delusion

Hello, I am a new Python entusiast, I am studing it since some weeks and I
think it's a great language and I was very happy with it, but when I came to
make a printer routine I really got demotivated by the difficulty, why does
Python covers easily the most complicated tasks and on the printer there is
this big hole? I was looking on the web, on newsgroups, to find some good
solution but I couldn't believe that there is this big lack on the printers,
as much I was happily surprised to find that Python handles easily diffucult
tasks, I had a big delusion to find out the lacks of Python on the print
problem, which is very important for me.

I really wish that soon will come out some implementation on the Python
native package to handle printing on the various platforms.

I saw that the most easy thing was to write a txt file and shell "notepad /p
filename" to print the data, (what a rude thing! imho), but that is not
enough cause I need to eloborate datas and print styled reports that I used
to code directly inside VB, but now I can't do it or is some cliffhanger
task.

I started to work also for unix platforms and I thought that Python was the
perfect language to write multiplatforms programs, I was so entusiast about
it that I couldn't believe that I had to go in that problem now.

I really would appreciate that the developers will develope soon a global
print function that one can use inside the code, that can use styled texts
and graphics and then the interpreter will care about the os and printers.

Bye and thanks for any suggestion, if any.

Mario

PS: Was all too good to be true :P lol
Jul 18 '05 #1
3 1520
Mario,

When you are new to something you may want to consider
going slow about criticism. Quite often what you want
exists and you are unaware of it at the beginning.

wxWindows has good support for printers and is cross platform.

Specifically take a look at wxPython.lib.pr intout. I use
PrintTable to do my table-style output quite a lot. It
provides you with Print Preview, scaling, etc. with little
effort.

or if you prefer

You can use ReportLab to produce .PDF output files.
With this you have fine-grained output capabilities and
get electronic cross-platform files which for some
applications is a real benefit (e.g web projects).

Hope information helps.

Regards,
Larry Bates

Mario wrote:
Hello, I am a new Python entusiast, I am studing it since some weeks and I
think it's a great language and I was very happy with it, but when I came to
make a printer routine I really got demotivated by the difficulty, why does
Python covers easily the most complicated tasks and on the printer there is
this big hole? I was looking on the web, on newsgroups, to find some good
solution but I couldn't believe that there is this big lack on the printers,
as much I was happily surprised to find that Python handles easily diffucult
tasks, I had a big delusion to find out the lacks of Python on the print
problem, which is very important for me.

I really wish that soon will come out some implementation on the Python
native package to handle printing on the various platforms.

I saw that the most easy thing was to write a txt file and shell "notepad /p
filename" to print the data, (what a rude thing! imho), but that is not
enough cause I need to eloborate datas and print styled reports that I used
to code directly inside VB, but now I can't do it or is some cliffhanger
task.

I started to work also for unix platforms and I thought that Python was the
perfect language to write multiplatforms programs, I was so entusiast about
it that I couldn't believe that I had to go in that problem now.

I really would appreciate that the developers will develope soon a global
print function that one can use inside the code, that can use styled texts
and graphics and then the interpreter will care about the os and printers.

Bye and thanks for any suggestion, if any.

Mario

PS: Was all too good to be true :P lol

1
Jul 18 '05 #2
"Larry Bates" <lb****@syscono nline.com> wrote:
When you are new to something you may want to consider
going slow about criticism. Quite often what you want
exists and you are unaware of it at the beginning.


Hi, thanks for the answer, mine was not a real criticism, was more a
delusion to see that a powerful thing such as Python needs external apps for
making a serious printing task, instead of having a set of built in
functions that handle it, no matter what os you are in or if you want, or
don't want to use/install wxWindows, or produce pdf, or shell "notepad /p",
my goal is to produce and sell to my clients complete packages that doesen't
require third party softwares or libraries. Also because often clients says
"no way" about installing other things than what is strictly needed (for
security and stability reasons) and wouldn't be nice to install some big
library just to make the print job; I would rather produce a small
executable in C (or VB for windows) so to be called when it's needed to
print, but I would still prefer a built in function so I'll have a complete
indipendent app :)

Thanks a lot for the info btw.

Mario

Jul 18 '05 #3
Mario wrote:
"Larry Bates" <lb****@syscono nline.com> wrote:
When you are new to something you may want to consider
going slow about criticism. Quite often what you want
exists and you are unaware of it at the beginning.


Hi, thanks for the answer, mine was not a real criticism, was more a
delusion to see that a powerful thing such as Python needs external apps for
making a serious printing task, instead of having a set of built in
functions that handle it, no matter what os you are in [...]


The problem is that different OSes have greatly different ideas of what
is involved in sending something to a printer. It is not a simple task
to print in a cross-platform way -- methods of finding/naming printers,
determining printer capabilities, formatting data to send to the
printer, etc., bear no relation to each other. In situations like this,
the Python team have a tradition of punting -- leaving it up to others
to develop libraries for the needed functionality. This is very much
like the situation with GUI libraries.

As it turns out, nobody (AFAIK) has developed a real stand-alone printer
library for Python. In most cases, it's not that difficult to use one
of the GUI toolkits that includes printer support, or deferring printing
through the use of Reportlab and PDFs, or using an OS-specific system
command for basic text printing (e.g. 'start notepad /p', or 'lpr', etc).

On the one hand, I can certainly see that there's a niche for just the
sort of tool you're asking about -- something that'll do fairly simple
styled-text printing in a cross-platform way. On the other hand, I
certainly don't have the time or skill to develop such a library, and
I'm not even certain that it's reasonably possible. I'm not sure that
there *is* a way to do styled-text printing, on either Windows or Linux,
without doing one of (a) working through the GUI subsystem, in which
case you might as well install wxPython or equivalent instead of
duplicating half of their code, or (b) using external tools to create
device-independent data files which can then be printed by another
external tool (i.e. PDFs or postscript), or (c) using printer-specific
control sequences which would be a nightmare to make even remotely
comprehensive.

It wouldn't be too hard to write a library that would let you write
plain, unstyled text to the current system's default printer... but
then, the benefit of having such a library is pretty slight, so why
bother? It's also easy enough to do this as a part of the application,
rather than in a library.

In short, while it *sounds* simple to say "just dump this stuff to the
printer", the reality is that it's not a very simple thing to do at all,
and difficult problems may have multiple best answers depending on the
specific circumstances.

Jeff Shannon
Technician/Programmer
Credit International

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
22312
by: Patrick Herb | last post by:
Hello, I'm trying to print the content of a RichTextBox from my VB 6 app. What I want is that the CommonDialog shows up, the user selects a printer and the content of the RichTextBox prints to the selected printer. I'm not concerned about the text format. What I tried is something like this CommonDialog1.ShowPrinter
2
2599
by: Jody Burgess | last post by:
Hi; I am writing my first python program and would like to know how to change stdout to refer to my default printer or any other printer on my network. The other question is, Is there an API set of classes that allow me to interact with network devices. In other words, if I have a path and filename inside of a string variable in python, how do I send the file to the printer?? Thanks in advance
7
6881
by: Steve M | last post by:
Hello, I'm having problems sending information from a python script to a printer. I was wondering if someone might send me in the right direction. I wasn't able to find much by Google TIA Steve
0
3666
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing problems have arisen. My investigations show that it is not related to the particular system I developed. but is affecting Access in general. So, has nothing to do with reports being set to print to a default printer (which they all are) or to a...
0
2592
by: Esmee | last post by:
Hi there, I have created an Access 2002 db which contains several reports. Some reports need to be printed on a Laserjet and others on a Labelprinter. One of my clients wants to be able to print the same reports to 3 different laserjets and to 3 different labelprinters. (They work with the db on 3 different units each with their own Laserjet and Labelprinter) For each unit there is a copy of all the reports. The client can make a unit...
1
12184
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to know how will this affect a report rendered by a crystal viewer. I have a web page with a crystal viewer rendering the report on the page. I build my application in one of my development machines and deploy it
2
5782
by: cjreynolds | last post by:
Please excuse my cluelessness on the subject - this is the first time I've worked with printing in VB (and it may be the last) and the more I work with it, the more confused I become... First, I'm setting the printer's scale and the X,Y position of the output: Sub SetLargePrinterScale(obj As Object, VertPosition As Single) Dim Owid As Single Dim Ohgt As Single Dim Pwid As Single Dim Phgt As Single Dim Xmid As Single
4
16824
ADezii
by: ADezii | last post by:
Recently, there seems to be several questions specifically related to Printers and changing Printing characteristics for Forms and Reports. For this reason alone, I decided to dedicate this week's Tip to these Topics. The Tip will actually consist of several Tips which I feel are very useful for all Users, from Newbies to Experts. In order to utilize the code contained within these Tips, you must have Access 2002 or later. How can I...
9
10349
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to find out how to do this. I have looked everywhere i know with no luck. Thank you in advance for your help.
0
9636
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.