[portland] Array writing question from landscape ecologist
crp at cmc.net
Sat Mar 13 02:24:12 CET 2010
Ethan Furman wrote:
> lintzh at science.oregonstate.edu wrote:
>> with open(outfilename,'w') as outfile:
>> for line in data4:
>> line.replace('[',' ').replace(']',' ')
> for line in data4:
> outfile.write(','.join([str(item) for item in line]))
Sorry to jump in here, but I am fairly new to Python programming, and
the syntax you are using in your answer is intriguing me. I missed the
question, as I just joined this group last night.
Could you please explain to me what the ','.join() is doing in your
I understand the code for the loop above, but it is new to me, so if
there is a mistake in it, that the question was about, I would
appreciate being informed of what I missed to facilitate my ultimate
understanding of the with construct, which I am pretty shaky on so far.
Thanks, 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