[Tutor] What's the invalid syntax? Code supplied

Nathan Pinno falcon3166 at hotmail.com
Thu Aug 4 05:03:25 CEST 2005


I added a plus sign to show Python to add "\n" or a new line to end of the 
file.
----- Original Message ----- 
From: "Danny Yoo" <dyoo at hkn.eecs.berkeley.edu>
To: "Nathan Pinno" <falcon3166 at hotmail.com>
Cc: "Tutor mailing list" <tutor at python.org>
Sent: Wednesday, August 03, 2005 8:53 PM
Subject: Re: [Tutor] What's the invalid syntax? Code supplied


>
>
> On Wed, 3 Aug 2005, Nathan Pinno wrote:
>
>> I forgot to add that it works because commas separate it into groups so 
>> that
>> when the reads the file it has output, the program can split it into the
>> site, ID, and passcard.
>
>
> Hi Nathan,
>
> Ok, it's good that we're looking back, because that's not right; commas
> did not have to do with what was causing problems.  Let's look at the
> buggy statement again.
>
>    out_file.write(site+","+sitelist[site][0]+","+sitelist[site][1]"\n")
>
> With fresh eyse, can you look back at how you corrected this?
>
>
> If you think this my insisting on you seeing why things weren't working,
> consider this: if it's an easy error to make (and it is an easy mistake to
> make), you may want to spend some time to learn how to recognize the error
> and its correction.  That way, you don't have to wait for folks on Tutor
> to point things out for you.
>
> 


More information about the Tutor mailing list