具有内容可编辑内容的HTML表格(在python中) [英] HTML table with contenteditable in python

查看:74
本文介绍了具有内容可编辑内容的HTML表格(在python中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用python创建一个带有contenteditable字段的HTML表.我正在使用python + flask.我已经准备好将数据作为字典,并且需要创建一个动态页面并显示项目.我正在检查几个模块,例如pyh和html.py.但是看起来没有什么适合我.任何帮助将不胜感激.

I would like to create a HTML table with contenteditable fields from python. I am using python + flask. I have the data ready as a dictionary and needs to create a dynamic page and display the items. I was checking couple of modules like pyh and html.py. But looks like nothing is well suited for me. Any help will be appreciated.

推荐答案

您需要使用Jinja2模板.您编写一个包含python代码插入的模板文件(有关文档,请参见此处),然后呈现模板作为使用flask方法的请求方法的返回值.因此,您可以使用 return render_template(args ...)结束请求方法.

You need to use a Jinja2 template. You write a template file which includes python code inserts (see here for the docs), and then render the template as the return value to a request method using the flask method. So you end your request method with return render_template(args...).

这篇关于具有内容可编辑内容的HTML表格(在python中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆