Someone please help, I can't get the variables of any functions to become global! Maybe this is something really simple that I'm missing, I don't know, but take a look:
>>> def func():
... global x
... x = 99
>>> print x
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'x' is not defined
Why? Shouldn't the "global" statement take care of this? What's going on? I need to do this for a program I'm working on, and can't get it to work. Any help would be greatly appreciated.
EDIT: I really feel like an idiot now. I NEVER RAN THE FUNCTION! Someone please delete this...