INNER CODE UNIT · Python
_convertListToCode
adminho/trading-stock-thailand · DeepQ_trade.py:101
def _convertListToCode(list):
# convert list to code in string
return "['" + "','".join(map(str, list )) + "']"
list_pic = _convertListToCode(all_pic)
list_pic = list_pic.replace("\\","/")
#output example
# list_pic = ['temp_pic/BBL_0.png', 'temp_pic/BBL_1.png', 'temp_pic/BBL_2.png']
#list_gain = _convertListToCode(all_gain)
f = open("log_template.html","r")
html_template = f.read()
f.close()
# inject lis_code into html template
html = html_template % (log_path, list_pic)
# and save html file
file_name = prefix_name + "_" + "log.html"