在python中创建HTML [英] Creating HTML in python

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

问题描述

我正在寻找一种方法来在python中动态创建html文件。我正在编写一个gallery脚本,它遍历目录,收集文件元数据。我打算然后使用这些数据自动创建一个基于html的图片库。非常简单的东西,只是一张图片。

我真的不认为手动写入文件是最好的方法,代码可能很长。那么有没有更好的方法来做到这一点,可能是HTML特定的?

请参阅此处


I am looking for a way to create html files dynamically in python. I am writing a gallery script, which iterates over directories, collecting file meta data. I intended to then use this data to automatically create a picture gallery, based on html. Something very simple, just a table of pictures.

I really don't think writing to a file manually is the best method, and the code may be very long. So is there a better way to do this, possibly html specific?

解决方案

I think, if i understand you correct, you can see here.

这篇关于在python中创建HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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