Ver Mensaje Individual
  #27  
Antiguo 04-04-2011
Avatar de D-MO
D-MO D-MO is offline
Miembro
 
Registrado: ago 2005
Ubicación: root@debian:/#
Posts: 1.042
Reputación: 20
D-MO Va por buen camino
¿Y si les dijera que Python por si solo es igual o peor que php?... Claro, desde el punto de vista de mezclar código html, javascript, python.

Pues eso, porfavor veamos el siguiente código:
Código:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# enable debugging
import cgitb
cgitb.enable()

print "Content-Type: text/plain;charset=utf-8"
print

print "<html><head><title>Hola</title></head><body>"

print "<ul>"

for i in range(10):
  print "<li>Hola %s</li>" % str(i)

print "</ul>"

print "</body></html>"
El código anterior es un archivo .py accesible desde el navegador, vía mod_python o bien via fasc_cgi.

Si ponemos PHP y Python en el mismo escenario veremos que realmente no hay mucha diferencia. La ventaja de Python en la web, como yo lo veo, han sido los frameworks.
Responder Con Cita