Re: Help writelines

2012-02-03 Thread Anatoli Hristov
Thanks guys that was fast: I used for line in users: fob.write(line + "\n") fob.close() and that works Excuse me for the stupid questions, but since one week I read alot of python and I`m confused :p the only program language I knew in the time was Pascal, but i forgot all of it cheers

Re: Help writelines

2012-02-03 Thread Dave Angel
On 02/03/2012 03:27 PM, Anatoli Hristov wrote: Hi everyone, I`m totaly new in python and trying to figure out - how to write a list to a file with a newline at the end of each object. I tried alot of combinations :) like: users = ['toli','didi'] fob=open('c:/Python27/Toli/username','w') fob.writ

Re: Help writelines

2012-02-03 Thread Nick Dokos
Anatoli Hristov wrote: > Hi everyone, > > I`m totaly new in python and trying to figure out - how to write a list to a > file with a newline at the end of each object. > I tried alot of combinations :) like: > users = ['toli','didi'] > fob=open('c:/Python27/Toli/username','w') > fob.writelines(

Re: Help writelines

2012-02-03 Thread Markus Rother
Hi, You have to iterate. Either with for u in users: fob.write( u + '\n' ) or with a lambda function. always a good call: http://python.org/ greets, M. On 02/03/2012 09:27 PM, Anatoli Hristov wrote: Hi everyone, I`m totaly new in python and trying to figure out - how to write a list t

Help writelines

2012-02-03 Thread Anatoli Hristov
Hi everyone, I`m totaly new in python and trying to figure out - how to write a list to a file with a newline at the end of each object. I tried alot of combinations :) like: users = ['toli','didi'] fob=open('c:/Python27/Toli/username','w') fob.writelines(users) + '%s\N' fob.close() or fob.writel