= Serveur Web minimaliste = == Arborescence du site de base == {{{ . ├── server.py* └── www ├── cgi │   ├── charts.py* │   └── command.py* ├── img │   └── peri.png ├── index.html └── peri.html }}} '''server.py''' {{{ #!/usr/bin/env python import BaseHTTPServer import CGIHTTPServer import cgitb; cgitb.enable() server = BaseHTTPServer.HTTPServer handler = CGIHTTPServer.CGIHTTPRequestHandler server_address = ("", 8000) handler.cgi_directories = ["/cgi"] httpd = server(server_address, handler) httpd.serve_forever() }}} '''index.html''' {{{ Peri Web Server }}} '''peri.html''' {{{ Peri Web Server

Controle Arduino

LED:
Statistiques:
}}} '''command.py''' {{{ #!/usr/bin/env python import cgi form = cgi.FieldStorage() val1 = form.getvalue('val1') print """

home

La valeur est ... %s
""" % (val1,) }}} '''charts.py''' {{{ #!/usr/bin/env python import cgi form = cgi.FieldStorage() #val1 = (int)(form.getvalue('val1')) val1 = 20 tab = [10,12,20,70,60,40] print """

home

""" }}}