On 2005-08-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Alright, everyone seems to have gone off on a tangent here, so I'll try
> to stick to your code...

> """
> This is what I would ideally like:
>
>
>   f = open("blah.txt", "r")
>   while c = f.read(1):
>       # ... work on c
>
>
> But I get a syntax error.
>
>
>     while c = f.read(1):
>            ^
> SyntaxError: invalid syntax
>
> """
>
> That's because you are using an assignment operator instead of a
> comparison operator.

That's because he wants an assignment operator.  He also wants
"c = f.read(1)" to be an expression that evalutates to the
value of c after the assignment operator.

-- 
Grant Edwards                   grante             Yow!  .. I'm IMAGINING a
                                  at               sensuous GIRAFFE, CAVORTING
                               visi.com            in the BACK ROOM of a
                                                   KOSHER DELI --
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to