<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
guys,<BR>its a text file i am writing to and when i write the first time its fine, i get 3 lines of input collected from a user and written to my&nbsp;text file, however if i run the program again the next 3 lines begin at the end of the previous users details.&nbsp; It works fine but starts from where the pointer left off.&nbsp; i dont know how to solve this.&nbsp; where&nbsp;do i put the '\n'?&nbsp; to be honest the <STRONG>.join </STRONG>i&nbsp;dont understand&nbsp;but otherwise it prints as a list e.g. ('name','age','etc')<BR><STRONG>Adrian&nbsp;</STRONG><BR>
&nbsp;<BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>&gt; Date: Thu, 19 Jan 2012 09:42:45 -0500<BR>&gt; Subject: Re: [Tutor] appending to a file on a new line<BR>&gt; From: joel.goldstick@gmail.com<BR>&gt; To: kellyadrian@hotmail.com<BR>&gt; CC: tutor@python.org<BR>&gt; <BR>&gt; On Thu, Jan 19, 2012 at 9:32 AM, ADRIAN KELLY &lt;kellyadrian@hotmail.com&gt; wrote:<BR>&gt; &gt; Hi everyone,<BR>&gt; &gt; is there an easy way to write to a file (that already exists with data<BR>&gt; &gt; contained) on a new line.&nbsp; I understand that the file pointer appends where<BR>&gt; &gt; it left off but how do i write to the next line or even skip a line if<BR>&gt; &gt; possible?<BR>&gt; &gt;<BR>&gt; &gt; User_info=open("C:\\Documents and<BR>&gt; &gt; Settings\\akelly\\Desktop\\details.txt",'a')<BR>&gt; &gt; User_info.write("\n".join(Details))<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; all the best,<BR>&gt; &gt; Adrian<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; Tutor maillist &nbsp;- &nbsp;Tutor@python.org<BR>&gt; &gt; To unsubscribe or change subscription options:<BR>&gt; &gt; http://mail.python.org/mailman/listinfo/tutor<BR>&gt; &gt;<BR>&gt; What you wrote looks fine. When you open a file to append, it does<BR>&gt; just that with the write method.<BR>&gt; <BR>&gt; You can learn more here<BR>&gt; http://docs.python.org/tutorial/inputoutput.html#methods-of-file-objects<BR>&gt; <BR>&gt; When you run your code what happens?<BR>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; Joel Goldstick<BR></DIV>                                               </div></body>
</html>