dimanche 4 janvier 2015

Whole page written in python

I have a problem. I have to write python script that takes input from user (choose from some predefined options), then do some work (that part I already have and it is working well) ale then print it as a web page output.


I tried something like this:



#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# enable debugging
import cgitb
cgitb.enable()
import subprocess
import os

print "Content-type: text/html\n\n";


data = "data"
output = "output"
.....

some work in gnuplot here

.....


web = "<html><body>"
web += "here is my web + button + img"
web += " <img src="http://localhost/img.png" alt="img">"
web += "</body></html>"
print web


I need to have on that page only Buttons (for refreshing page and executing script refresh) and Image... Any idea ? I look on web and found HTMLtags.py or bottle.py but i do not have any idea how it is working...


Thanks





Aucun commentaire:

Enregistrer un commentaire