[Tutor] Printer output

Lloyd Kvam pythontutor@venix.com
Mon, 13 May 2002 10:37:35 -0400


Taking an easy piece, the print statement is the python equivalent of
ostream.  Both default to stdout. print >> allows you to print to a
different file.

Alan Trautman wrote:

> 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
> 
> 


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582