def view_log()->'html': #ç?kt? html olaca?? için de?i?tirdik
content= [] #bo? bir liste olu?turduk
with open('einstein.log') as log:
for line in log:
content.append([]) #content listesine bo? bir liste daha ekledik. Her bir sat?r için olu?acak
for item in line.split('|'): #sat?r | i?aretine göre ayr??t?r?p içindeki her bir ö?eyi ele al
content[-1].append(escape(item)) # -1 ile listenin en sonuna eleman eklemi? oluyoruz.
titles=('Form Data','Remote_addr', 'User_agent','Results') #log tablosundaki ba?l?klar? tutacak bir tuple
return render_template('log.html',
the_title='Calculation Logs',
row_titles=titles,
log_data=content,)
评论列表
文章目录