Ceci est une ancienne révision du document !
Exécuter Python sur OVH
Mettre le fichier .cgi dans /cgi-bin/
Passer le fichier en exécutable (705)
Contenu du fichier :
#!/usr/bin/python # -*- coding: UTF-8 -*- print("Content-type: text/html\n\n") print("Hello World!")
Ou
#!/usr/bin/python # -*- coding: UTF-8 -*- print("Content-type: text/html\n\n") from random import * for i in range (1,10): print (random())
Pour afficher :
http://physix.fr/cgi-bin/test.cgi
Autres exemples :
https://fr.wikibooks.org/wiki/Programmation_Python/L'interface_CGI