Il giorno sab, 10/04/2010 alle 17.41 +0200, Valerio Pachera ha scritto: > Il 01 aprile 2010 19.15, Pietro Battiston <too...@email.it> ha scritto: > > Un esempio funzionante: > > > > http://mail.python.org/pipermail/tutor/2003-August/024857.html > > Questo sembra essere quello che più si addice al caso mio. > Ho provato l'esempio postato e funziona a dovere. > Tutto quello che ho dovuto fare su debian lenny è stato: > > 1-installare apache > 2-posizionare lo scirpt in /usr/lib/cgi-bin/test.py > 3-creare un form con action="cgi-bin/test.py" > (lo riporto in fondo a questa mail nel caso passa interessare a qualcuno) > > Ora volevo fare delle prove. Visto che lo script restituisce codice > html ho provato a fare in modo che lo script restituisca solo una > pagina html minimale. > Quindi ancora più semplice dell'esempio. Non capisco perché, ma > ottengo errore 500 "The server encountered an internal error or > misconfiguration and was unable to complete your request. ..."
Nota il print "Content-type: text/html" all'inizio del mio script... ciao Pietro > > Questo è il codice di test.py > --------- > import cgi, sys, string, cgitb > cgitb.enable() > > #form = cgi.FieldStorage( ) > > html = """ > <html> > <head> <title>Prove Python</title> </head> > > <body> > <h1>greetings</h1> > hello world > </body> > > </html> > """ > > print html > ------- > > poi punto il browser su > http://localhost/cgi-bin/test.py > e ottengo l'errore citato in precedenza. > > Da notare inoltre che ho importato e attivato cgibt per ottenere > degli errori più utili al debug ma non sembra funzionare > http://docs.python.org/library/cgi.html > > nota: sto usando python 2.5. > > > > > FORM PER L'ESEMPIO DEL LINK > <hrml> > <head> > </head> > <body> > <form method="post" name="test" action="cgi-bin/test.py"> > <input type="text" name="name" /> > <input type="text" name="shoesize" /> > <input type="text" name="job" /> > <input type="text" name="language" /> > > <input type="text" name="comment" /> > <input type="submit" name="submit" value="invia"/> > </form> > </body> > </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