INNER CODE UNIT · Python

createLogHTML

adminho/trading-stock-thailand · DeepQ_trade.py:100

def createLogHTML(prefix_name, log_path, all_pic):		
	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	

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…