30 Dec 2005 20:22:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > if i use the code below to write a list to a file > > list = (food, price, store) > data.append(list) > f = open(r"test.txt", 'a') > f.write ( os.linesep.join( list ) ) > > > it outputs to a file like this > > apple > .49 > star market > > and i want it to do > > apple, .49. star market > > any ideas >
my box is windows xp, so : >>> print repr(os.linesep) '\r\n' If you want to seperate them with space, you should: f.write ( ''.join( list ) ) and list = (food, price, store) the list is not called "list", but "tuple", a real list should be aList = [food, price, store] -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit -- http://mail.python.org/mailman/listinfo/python-list