[portland] Array writing question from landscape ecologist

Ray Parrish crp at cmc.net
Sat Mar 13 12:55:52 CET 2010

John Naylor wrote:
> On Fri, Mar 12, 2010 at 5:24 PM, Ray Parrish <crp at cmc.net>
>>>          for line in data4:
>>>              outfile.write(','.join([str(item) for item in line]))
>> Could you please explain to me what the ','.join() is doing in your write
>> command?
> See here:
> http://www.python.org/doc/faq/general/#why-is-join-a-string-method-instead-of-a-list-or-tuple-method
> John
I know what join does, but why are you appending it's call to a "," 
string? That's what I don't understand. I've never seen that used 
before. You have it joined to that string with a dot, unless that was a 
typo. 8-)

Later, Ray Parrish

Linux dpkg Software Report script set..
Ray's Links, a variety of links to usefull things, and articles by Ray.
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.

More information about the Portland mailing list