web_portal.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:LearningPython 作者: buraksenyurt 项目源码 文件源码
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,)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号