Global name "userid" not defined??

Sean Berry sean_berry at
Tue Mar 30 17:53:47 CEST 2004

How do I rectify this?


def setUserid(value):
    userid = value

def getUserid():
    return userid


>>>import vars

Then I get a Traceback error and the last line says:
NameError: name 'userid' is not defined

How do I make a variable global?

Sorry about the easy question... but I don't have all that much experience
in Python.

More information about the Python-list mailing list