help: output arrays into file as column

bei beiwang2003 at gmail.com
Thu Jul 27 14:03:13 EDT 2006


Hi,

I am trying to write several arrays into one file, with one arrays in
one column. Each array (column) is seperated by space.
ie. a=[1,2,3, 4] b=[5,6,7,8] c=[9,10,11,12]
1  5  9
2  6  10
3  7  11
4  8  12

Now I use the function file.writelines(a), file.writelines(b),
file.writelines(c). And the output is a sequence of strings without
newlines between a, b ,c . Also each array stays in row other than
column.

I am a new comer to python.Any idea about this is appreciated!

Bei




More information about the Python-list mailing list