[Tutor] Printer output

Alan Trautman ATrautman@perryjudds.com
Mon, 13 May 2002 09:09:12 -0500


Thanks for the help. I should have been clearer in my question.

I have a variable size collection of CSV tables of variable length. I want
to parse these, do a bunch of simple calcs. These are the easy parts.

Finally I need them to create printed reports (HP LaserJet's if it matters)
locally or across as Windows NT network. I am currently leaning to adding a
simple web server and creating HTML but want to know if something like the
ostream command in C exhists at least for trouble shooting. The ideal if I
could find some docs/example is an XML based system using different style
sheets for the different views but don't know much about either of these
techniques.

Peace
Alan


-----Original Message-----
From: dman [mailto:dman@dman.ddts.net]
Sent: Friday, May 10, 2002 3:11 PM
To: 'tutor@python.org'
Subject: Re: [Tutor] Printer output


On Fri, May 10, 2002 at 02:54:16PM -0500, Alan Trautman wrote:

| I am wondering if there is any documentation about formatting printed
| reports in Python? I need to parse, perform calculations and then produce
a
| few summary reports and I'm wondering if there is a good template type
setup
| to use.

man printf

or is that not what you mean by "print"?

Python has built-in support for string formatting with the same rules
as C's printf family of functions.  With it you can align columns and
format numbers, etc.

As for outputing formatted data, the options really depend on what the
communication medium is.  There are template systems for web (html)
stuff, it isn't too hard to generate some LaTeX as long as you know
the tables won't have any page breaks in them.

HTH,
-D

-- 

How to shoot yourself in the foot with Java:

You find that Microsoft and Sun have released incompatible class
libraries both implementing Gun objects. You then find that although
there are plenty of feet objects implemented in the past in many other
languages, you cannot get access to one. But seeing as Java is so cool,
you don't care and go around shooting anything else you can find.
    (written by Mark Hammond)
 
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg