Il giorno sab, 10/04/2010 alle 18.36 +0200, Valerio Pachera ha scritto: > Il 10 aprile 2010 18.19, Pietro Battiston <too...@email.it> ha scritto: > > > Nota il > > print "Content-type: text/html" > > all'inizio del mio script... > > Mmmmm...questo non mi è chiarissmi. Chi legge / achi serve > "Content-type: text/html" ? > Subito pensavo fosse parte del codice html della pagina (che andasse a > prendere il posto di doctype e tutta la pappardella). > Ora noto pero che leggendo l'html della pagina generata dal tuo > script, non è presente "Content-type: text/html". > > Se lo commento e provo a ricaricare la pagina, mi vhiene chiesto di > scaricare test.py (quindi non lo esegue). > > Beh, ho provato a ri-aggiungerlo al mio codice...ma ottengo lo stesso errore
Se provi anche ad aggiungere un "#! /usr/bin/python" all'inizio? In genere, ricorda che il comando sudo tail /var/log/apache2/error.log è tuo amico! ciao Pietro > > --------- > import cgi, sys, string, cgitb > cgitb.enable() > > > print "Content-type: text/html" > print > > form = cgi.FieldStorage( ) > > html = """ > <html> > <head> <title>Prove Python</title> </head> > > <body> > <h1>greetings</h1> > hello world > </body> > > </html> > """ > > print html > --------- > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python