delimiting text file??
Aahz Maruch
aahz at netcom.com
Thu Oct 14 18:23:33 EDT 1999
In article <7u5da5$pp2$1 at nntp6.u.washington.edu>,
Donn Cave <donn at u.washington.edu> wrote:
>Quoth Gerrit Holl <gerrit.holl at pobox.com>:
>| Aahz Maruch:
>[re how to insert comma delimiters]
>
>|> delimitedString = string[:x] + "," + string[x:]
>|>
>|> That's a rather lame way to do it; as you learn more about Python,
>|> you'll come across better ways.
>|
>| Is it? I think I've learned more about Python than Jim has (already finished
>| Learning python, and I'm waiting for Programming TkInter with Python now),
>| but I don't know a better way than this?
>
>He may have gauged better than I the original poster's zeal for
>discovering things on his own, but I was surprised no one mentioned
>string.join'ing a list of fields in one step. It's what I consider
>the normal approach to this common task. Easier on the eyes, probably
>faster if there are more than a couple of fields.
Oh, I agree -- but the original poster didn't say anything about a list
of fields....
--
--- Aahz (@netcom.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6 (if you want to know, do some research)
More information about the Python-list
mailing list