全局变量
This commit is contained in:
parent
5050bfb169
commit
df60514154
@ -17,21 +17,19 @@ def _init(): # 初始化
|
|||||||
_global_dict = {}
|
_global_dict = {}
|
||||||
|
|
||||||
# ws列表存储
|
# ws列表存储
|
||||||
global active_connections
|
global _active_connections
|
||||||
active_connections = multiprocessing.Manager().list()
|
_active_connections = multiprocessing.Manager().list()
|
||||||
|
|
||||||
# ws字典存储
|
# ws字典存储
|
||||||
global active_connections_dist
|
global _active_connections_dist
|
||||||
active_connections_dist = multiprocessing.Manager().dict()
|
_active_connections_dist = multiprocessing.Manager().dict()
|
||||||
|
|
||||||
|
|
||||||
def get_active_connections():
|
def get_active_connections():
|
||||||
global active_connections
|
return _active_connections
|
||||||
return active_connections
|
|
||||||
|
|
||||||
def get_active_connections_dist():
|
def get_active_connections_dist():
|
||||||
global active_connections_dist
|
return _active_connections_dist
|
||||||
return active_connections_dist
|
|
||||||
|
|
||||||
def set_value(key, value):
|
def set_value(key, value):
|
||||||
# 定义一个全局变量
|
# 定义一个全局变量
|
||||||
|
Loading…
x
Reference in New Issue
Block a user