本文整理汇总了Python中UI.print_info方法的典型用法代码示例。如果您正苦于以下问题:Python UI.print_info方法的具体用法?Python UI.print_info怎么用?Python UI.print_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI.print_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dict
# 需要导入模块: import UI [as 别名]
# 或者: from UI import print_info [as 别名]
__author__ = 'matsrichter'
import numpy as np
import UI
test_dict = dict()
capital = range(0,1000,1)
total_account_val = range(0,2000,2)
test_dict['capital'] = 1000
UI.print_info_intro(True)
for i in range(len(capital)):
test_dict['capital'] = capital[i]
test_dict['account_val'] = total_account_val[i]
if((i+1)%25 == 0):
UI.print_info_intro(True)
UI.print_info(test_dict)
示例2: if
# 需要导入模块: import UI [as 别名]
# 或者: from UI import print_info [as 别名]
dict = {}
dict = sender_receiver.receive()
if(dict == ""):
continue
tstep = tstep + 1
if(optflag == False):
optimizer = os.Optimization_System(dict['anti_risk'],dict['capital'])
optflag = True
if('ERROR' in dict):
UI.printErr()
else:
# if(tstep%9000 == 0):
# UI.print_info_intro()
# if(tstep%180 == 0):
# UI.print_info(Instruction_dict.values)
UI.print_info_intro()
print dict
UI.print_info(dict)
#change params and send
if(tstep >= 100):
Instruction_dict.values = optimizer.optimize(dict)
time.sleep(1)
#Instruction_dict.values = optimizer.optimize(Instruction_dict.values)
#print Instruction_dict.values
示例3:
# 需要导入模块: import UI [as 别名]
# 或者: from UI import print_info [as 别名]
# init FX_Reader and sender
# init the rest of parameters
# send the dictionary
sender_receiver = sr.Sender_Receiver()
optimizer = os.Optimization_System(instruction_dict["anti_risk"], instruction_dict["capital"])
reader = fxr.FX_Reader()
while True:
if "ERROR" in instruction_dict:
UI.printErr()
else:
if tstep % 9000 == 0:
UI.print_info_intro()
if tstep % 180 == 0:
UI.print_info(instruction_dict)
# change params and send
if tstep >= 10000:
instruction_dict = optimizer.optimize(instruction_dict)
# change params and send
instruction_dict = optimizer.optimize(instruction_dict)
instruction_dict["long_price"], instruction_dict["short_price"] = reader.readPrice()
sender_receiver.send(instruction_dict)
tstep += 1
instruction_struct = ""
while instruction_struct == "":
instruction_struct = sender_receiver.receive()
if instruction_struct == "":
time.sleep(1)