Welcome to the Strap template.
If you don't known the ComboStrap, it's recommended to follow the Getting Started Guide.
Otherwise, to create a menu bar in the header, create a page with the id (slot_header) and the menubar component.
Action unknown: siteexport_addpage

Exécuter Python sur OVH

La base

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

===== Pour afficher les erreurs =====

import cgitb
cgitb.enable()

Compteur de visite

#!/usr/bin/python
from datetime import datetime
import cgitb
cgitb.enable()

print 'Content-type: text/html'
print
print (datetime.now())

try:
    fichier = open('compteur','r')
    nbr_visiteurs = int(fichier.read())
except Exception:
    nbr_visiteurs = 0
fichier = open('compteur','w')
fichier.write(str(nbr_visiteurs+1))
print nbr_visiteurs+1,'visites \o/'

Liens

Welcome to the Strap template. To get started, create a page with the id slot_footer to create a footer.
Powered by ComboStrap