How can I save some value to global variable?
There is a example script:
GLOBAL_VAR = None
if GLOBAL_VAR is None:
GLOBAR_VAR = new_var
print "In: " + str(GLOBAL_VAR)
print "Out: " + str(GLOBAL_VAR)
There are typo in your script ( you assign to GLOBAR_VAR not to GLOBAL_VAR).
Update assignment from
GLOBAR_VAR = new_var to
GLOBAL_VAR = new_var and everything would work as expected.