123456789101112131415161718192021222324252627282930 |
- import gc
- import logging
- def _init():
- global global_dict
- global_dict = {}
- def update(_dict):
- # 定义一个全局变量
- try:
- global_dict.update(_dict)
- except Exception as e:
- return
- def get(key):
- # 获得一个全局变量
- try:
- value = global_dict.get(key)
- except Exception as e:
- value = None
- return value
- def _del():
- global global_dict
- del global_dict
- gc.collect()
|