2024-02-12 14:19:56 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
def _init(): # 初始化
|
|
|
|
global _global_dict
|
2024-02-14 08:34:11 +00:00
|
|
|
_global_dict = {"FromGUI":False}
|
2024-02-12 14:19:56 +00:00
|
|
|
|
|
|
|
def set_value(key, value):
|
|
|
|
#定义一个全局变量
|
|
|
|
_global_dict[key] = value
|
|
|
|
|
|
|
|
def get_value(key):
|
|
|
|
#获得一个全局变量,不存在则提示读取对应变量失败
|
|
|
|
try:
|
|
|
|
return _global_dict[key]
|
|
|
|
except:
|
|
|
|
print('读取'+key+'失败\r\n')
|
|
|
|
|