GLOBAL variables in python

Max Møller Rasmussen maxm at normik.dk
Tue Nov 7 13:18:24 CET 2000


From: python9999 at my-deja.com [mailto:python9999 at my-deja.com]

>a= myclass()
>def  get():
>	name=a.entry.entry1.get_text()
>	return name

You need to declare it global inside the method:

a= myclass()
def  get():
    global a
    name=a.entry.entry1.get_text()
    return name




More information about the Python-list mailing list