web - python读取数据库后生成html网页
天蓬老师
天蓬老师 2017-04-17 14:46:41
0
2
807

数据已经读出,如何让他形成网页
数据库代码如下图

求 如何把row内容输出到网页中去。急急!!!

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
左手右手慢动作

If you want to output to the terminal, just like this:

pythonprint '<p class="row">'+ row +'</p>' 

If you want to write to a file, you first piece together the string of the web page as above, and then write it to the .html file.

大家讲道理

Webserver (such as apache) enables python parsing (such as cgi). Please refer to relevant manuals and tutorials for this
Write #python parser path in the first line of the script
The script is output as print html code
Give the directory where the script is stored and the script itself permission to run
Then http://.../script path can be accessed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!