[Discuss] A question for the Python gurus

Adam Parkin pzelnip at telus.net
Sun Jul 30 14:11:47 PDT 2006


Deryk Barker wrote:
>> Or am I just missing something? 
> 
> You need to specify that a variable is global if your first use within a 
> fuinction is assignment. So,
> 
> def foo():
>    global lines
>    lines = sys.stdin.readline()

Ahhhh, that would be what I was missing.  Thanks. =8->

-- 
--
Adam Parkin
E-mail: pzelnip at telus.net
----------------------
  A student who changes the course of history is probably taking an exam.


More information about the Discuss mailing list