On Oct 19, 3:33 pm, dirkheld <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would l like to write some data to a text file. I want to write the
> data with whitespace or tabs in between so that I create tabular
> columns like in a spreadsheet. How can I do this in python.
> (btw, I'm new to python)
>
> names = ['John','Steve','asimov','fred','jim']
> ## output I would like in txt file : John         Steve
> asimov      fred     jim
>
> f=open('/User/home/Documents/programming/python/test.txt','w')
>         for x in range(len(names)):
>                 f.write(tags[x])
>         f.close()

I'm not sure exactly but you'll probably need to find out what the
ASCII code is for a tab.  Personally I would just write data straight
into Excel using the win32 extensions.  I'm sure the same can be
achieved with OO on a Linux box.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to