本文整理汇总了Python中memory.Memory.setGlobalMemory方法的典型用法代码示例。如果您正苦于以下问题:Python Memory.setGlobalMemory方法的具体用法?Python Memory.setGlobalMemory怎么用?Python Memory.setGlobalMemory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类memory.Memory
的用法示例。
在下文中一共展示了Memory.setGlobalMemory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: listParams
# 需要导入模块: from memory import Memory [as 别名]
# 或者: from memory.Memory import setGlobalMemory [as 别名]
list_param = listParams(string[1])
if string[5] == 'None':
quad_init = None
else:
quad_init = int(string[5])
cont_int = int(string[2])
cont_float = int(string[3])
cont_bool = int(string[4])
cont_tint = int(string[6])
cont_tfloat = int(string[7])
cont_tbool = int(string[8])
cont_p = int(string[9])
tipo_return = string[10]
directory[string[0]] = [list_param, quad_init, cont_int, cont_float, cont_bool, cont_tint, cont_tfloat, cont_tbool, cont_p, tipo_return]
if string[0] == "*work*":
memoria.setGlobalMemory(cont_int, cont_float, cont_bool, cont_tint, cont_tfloat, cont_tbool, cont_p)
if read == 2:
esint = re.compile(pattn_int)
esfloat = re.compile(pattn_float)
esstring = re.compile(pattn_string)
if re.match(esstring, string[0]):
key = string[0]
elif re.match(esfloat, string[0]):
key = float(string[0])
elif re.match(esint, string[0]):
key = int(string[0])
constants[int(string[1])]=key
if read == 3:
temp = [string[1], string[2], string[3], string[4]]
quad.append([int(string[0]),temp])
示例2: listParams
# 需要导入模块: from memory import Memory [as 别名]
# 或者: from memory.Memory import setGlobalMemory [as 别名]
list_param = listParams(string[1])
if string[5] == 'None':
quad_init = None
else:
quad_init = int(string[5])
cont_int = int(string[2])
cont_float = int(string[3])
cont_bool = int(string[4])
cont_tint = int(string[6])
cont_tfloat = int(string[7])
cont_tbool = int(string[8])
cont_p = int(string[9])
tipo_return = string[10]
directory[string[0]] = [list_param, quad_init, cont_int, cont_float, cont_bool, cont_tint, cont_tfloat, cont_tbool, cont_p, tipo_return] #Regenera una entrada del directorio de modulos
if string[0] == "*work*":
memoria.setGlobalMemory(cont_int, cont_float, cont_bool, cont_tint, cont_tfloat, cont_tbool, cont_p) #Establece el mapa de memoria global
if read == 2:
esint = re.compile(pattn_int)
esfloat = re.compile(pattn_float)
esstring = re.compile(pattn_string)
if re.match(esstring, string[0]): #Verifica si la constante es de tipo entero
key = string[0]
elif re.match(esfloat, string[0]): #Verifica si la constante es de tipo flotante
key = float(string[0])
elif re.match(esint, string[0]): #Verifica si la constante es de tipo string
key = int(string[0])
constants[int(string[1])]=key #Regenera una entrada de la tabla de constantes
if read == 3:
temp = [string[1], string[2], string[3], string[4]] #Regenera la secuencia de cuadruplos a ejecutar.
quad.append([int(string[0]),temp])