On Thu, Jan 19, 2012 at 9:32 AM, ADRIAN KELLY <kellyadr...@hotmail.com> wrote:
> Hi everyone,
> is there an easy way to write to a file (that already exists with data
> contained) on a new line.  I understand that the file pointer appends where
> it left off but how do i write to the next line or even skip a line if
> possible?
>
> User_info=open("C:\\Documents and
> Settings\\akelly\\Desktop\\details.txt",'a')
> User_info.write("\n".join(Details))
>
>
> all the best,
> Adrian
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
What you wrote looks fine.  When you open a file to append, it does
just that with the write method.

You can learn more here
http://docs.python.org/tutorial/inputoutput.html#methods-of-file-objects

When you run your code what happens?


-- 
Joel Goldstick
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to