17 lines
262 B
Python
17 lines
262 B
Python
|
|
# globalvar.py
|
||
|
|
|
||
|
|
def _init():
|
||
|
|
global _global_dict
|
||
|
|
_global_dict = {}
|
||
|
|
|
||
|
|
|
||
|
|
def set_value(name, value):
|
||
|
|
_global_dict[name] = value
|
||
|
|
|
||
|
|
|
||
|
|
def get_value(name, defValue=None):
|
||
|
|
try:
|
||
|
|
return _global_dict[name]
|
||
|
|
except KeyError:
|
||
|
|
return defValue
|