[Tutor] Alternative File I/O for Tuples

2005-06-25 Thread Don Parris
When I pickle a SQL result into a file (ASCII mode), it lays out the data in an interesting format. When I send it to the printer, I'd like to see it arranged more like it is on the console screen - in tabbed columns. None of the tutorial type stuff I've seen even mentions printing files, or acce

Re: [Tutor] Alternative File I/O for Tuples

2005-06-25 Thread Danny Yoo
> I would like to see something more like when the file is printed: > > AustinJames704-111-1234 > AustinJanet704-111-1234 > etc. > > Is this a simple task, or am I jumping into deep water? :) Hi Don, Not too bad; I think you'll looking for "String Formatting": http://www.p

Re: [Tutor] Alternative File I/O for Tuples

2005-06-25 Thread Danny Yoo
> In your example, it looks like every row is ten characters long. A ^^^ Hi Don, Gaa, that's why I'm so bad at matrix math. I meant "column", not "row". Sorry about that. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Alternative File I/O for Tuples

2005-06-26 Thread Kent Johnson
Don Parris wrote: > When I pickle a SQL result into a file (ASCII mode), it lays out the data in > an interesting format. pickle format is not intended for pretty-printing or readability for that matter. You have to write the file yourself in the format you want. > When I send it to the printe

Re: [Tutor] Alternative File I/O for Tuples

2005-06-26 Thread Alan G
> arranged more like it is on the console screen - in tabbed columns. None of > the tutorial type stuff I've seen even mentions printing files, One reason is that printing is one of those things that is different on evry operating system. So tutorials (including mine) tend to steer clear of it. I

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-26 Thread Danny Yoo
-- Forwarded message -- Date: Sun, 26 Jun 2005 14:29:22 -0400 From: Don Parris <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Alternative File I/O for Tuples On Sat, 25 Jun 2005 22:52:08 -0700 (PDT) Danny Yoo <[EMAIL PROTECTED]>

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-26 Thread Kent Johnson
> From: Don Parris <[EMAIL PROTECTED]> > To: Danny Yoo <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Alternative File I/O for Tuples > > I guess I'm asking two closely-related questions: > (1) how to format the file so it can be readable, and If you like the recip

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-27 Thread Don Parris
On Sun, 26 Jun 2005 16:32:08 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > > From: Don Parris <[EMAIL PROTECTED]> > > To: Danny Yoo <[EMAIL PROTECTED]> > > Subject: Re: [Tutor] Alternative File I/O for Tuples > > > > I guess I'm asking two

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-27 Thread Don Parris
On Sun, 26 Jun 2005 16:32:08 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > > From: Don Parris <[EMAIL PROTECTED]> > > To: Danny Yoo <[EMAIL PROTECTED]> > > Subject: Re: [Tutor] Alternative File I/O for Tuples > > > > I guess I'm asking two

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-28 Thread Kent Johnson
Don Parris wrote: > Just getting back to this - Mondays are always hectic. This recipe is the > one I saw and like. It looks cool! In my brief efforts tinkering with it, > I am not really getting very far. I saved the recipe, and import it into > the file containing all my database functions.

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-28 Thread Don Parris
On Tue, 28 Jun 2005 05:50:54 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > Just getting back to this - Mondays are always hectic. This recipe is > > the one I saw and like. It looks cool! In my brief efforts tinkering > > with it, I am not really getting very far. I sav

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Kent Johnson
Don Parris wrote: > On Tue, 28 Jun 2005 05:50:54 -0400 > Kent Johnson <[EMAIL PROTECTED]> wrote: >>The problem is you are just passing one record to indent(). It processes >>the whole table at once so you have to pass the list of records, i.e. >>mbrPhone.write(indent(Results, hasHeader=Fals

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Don Parris
On Wed, 29 Jun 2005 06:38:36 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > On Tue, 28 Jun 2005 05:50:54 -0400 > > Kent Johnson <[EMAIL PROTECTED]> wrote: Thanks for the explanation of indentation! I kind of understood that, but wanted to be sure I understood correctly w

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Kent Johnson
Don Parris wrote: > On Wed, 29 Jun 2005 06:38:36 -0400 > Kent Johnson <[EMAIL PROTECTED]> wrote: >>Don Parris wrote: > However, it seems that the function doesn't like the > value I give it. > > ### Using Results as the argument to indent() ### > Traceback (most recent call last): > File "ekkles

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Don Parris
On Wed, 29 Jun 2005 12:37:45 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > On Wed, 29 Jun 2005 06:38:36 -0400 > > Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Don Parris wrote: > > This is a tough one to interpret. The value being returned from wrapfunc() > is expected to

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Kent Johnson
Don Parris wrote: > ### playing with wrapfunc (all other args are the same) ### > wrapfunc=lambda x:wrap_onspace(str(rows), x)) > > also > wrapfunc=lambda x:str(wrap_onspace(rows, x))) This is way off base. wrap_onspace takes two arguments - the string to wrap, and the width to wrap to. You are

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-29 Thread Don Parris
On Wed, 29 Jun 2005 14:09:41 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > Don Parris wrote: > > ### playing with wrapfunc (all other args are the same) ### > > wrapfunc=lambda x:wrap_onspace(str(rows), x)) > > > > also > > wrapfunc=lambda x:str(wrap_onspace(rows, x))) > > This is way off base

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-07-01 Thread Jacob S.
- Original Message - From: "Don Parris" <[EMAIL PROTECTED]> To: Sent: Thursday, June 30, 2005 12:23 AM Subject: Re: [Tutor] Alternative File I/O for Tuples (fwd) > On Wed, 29 Jun 2005 14:09:41 -0400 > Kent Johnson <[EMAIL PROTECTED]> wrote: > >> Do

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-07-01 Thread Don Parris
On Fri, 1 Jul 2005 12:09:03 -0500 "Jacob S." <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: "Don Parris" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 30, 2005 12:23 AM > Subject: Re: [Tutor] Alternative File I/O for T