Here's an example from some book:
def foo(n):
s = [n]
def bar(i):
s[0] += i
return s[0]
return bar
what I don't understand is how this example works, taking into account
the LGB rule. I thought that s is not accessible from bar, but it is,
Erik Max Francis wrote:
> ... modern versions of
> Python allow iteration over a file, which will read it line by line:
>
> for line in aFile:
> ...
>
Thanks! Just what I need.
--
http://mail.python.org/mailman/listinfo/python-list
Does a call to file.readlines() reads all lines at once in the memory?
Are the any reasons, from the performance point of view, to prefer
*while* loop with readline() to *for* loop with readlines()?
--
http://mail.python.org/mailman/listinfo/python-list