Re: Creating Fixed Length Records

2004-12-09 Thread Andrew James
Greg, Absolutely *perfect* case for a dose of Python string concatenation performance theory or, How To Join Strings Together Fast: http://www.skymind.com/~ocrow/python_string/ HTH, Andrew On Wed, 2004-12-08 at 17:29 -0600, Greg Lindstrom wrote: > Hello- > > I'm creating fixed-length record lay

Re: Creating Fixed Length Records

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 17:29:19 -0600, Greg Lindstrom wrote: > One thought I had, which might lead to an addition to the language, was > to use the struct module. If I could feed the pack method a format > string then a tuple of values (instead of individual values), then I > could create the fo

Re: Creating Fixed Length Records

2004-12-08 Thread Jeff Shannon
Greg Lindstrom wrote: [...] I concatenate the field to the text segment. I have been led to believe this is bad form because Python will copy the entire segment each time I add a field. Up until now, it was not a big deal because the segments had at most 20 fields. I have just been handed a r

Creating Fixed Length Records

2004-12-08 Thread Greg Lindstrom
Hello- I'm creating fixed-length record layouts for various record translations I need to perform. I have been using a home-grown object, "FixedLengthRecord" for about 4 years now and am very happy with it. Almost. The burr under my saddle occurs when I serialize the record. Currently, I cr