开发者社区> 问答> 正文

如何显示python控制台输出在html页面?

def execute():

print("this is imam")

print('this akarsh')

print('this is abhi')

@app.route('/')

def home ():

return render_template('index.html', x= execute())

我只是想打印上面三个打印语句在我的html页面上。

展开
收起
游客6qcs5bpxssri2 2019-10-11 16:57:05 3171 0
2 条回答
写回答
取消 提交回答
  • 不用render_template

    用response直接输出到html页面.

    2019-11-04 18:10:37
    赞同 展开评论 打赏
  • def execute():

    return """
    
        this is imam
    
        this akarsh
    
        this is abhi
    
    """
    
    2019-10-11 16:57:32
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
天猫HTML5互动技术实践 立即下载
Improving Python and Spark Per 立即下载
DTS控制台一本通 立即下载