#!/usr/bin/python3
# coding: utf-8
"""
https://python.doctor/page-python-serveur-web-creer-rapidement
https://info.blaisepascal.fr/nsi-serveur-http-python-cgi
"""
import cgi 

form = cgi.FieldStorage()
print("Content-type: text/html; charset=utf-8\n")

print(form.getvalue("name"))

html = """<!DOCTYPE html>
<head>
    <title>Mon programme</title>
</head>
<body>
    <form action="/index.py" method="post">
        <input type="text" name="name" value="Votre nom" />
        <input type="submit" name="send" value="Envoyer information au serveur">
    </form> 
</body>
</html>
"""

print(html)
