Python in HTML

Tim Roberts timr at probo.com
Sun Jun 25 23:19:06 EDT 2006


brochu121 at gmail.com wrote:
>
>Does anyone know of a way to embed python scripts into html, much like
>you would javascript or php? I do not want to use this to connect to a
>database, but rather for a functional script to be called when a user
>clicks on a link to open a page.

If you are running Windows, and you have Python installed, and you have the
Python-Win32 extensions installed, then there is a script you can run which
installs Python as one of the "Windows scripting languages".  After that,
you can run Python code in HTML just like Javascript:

  <script language="Python">
    print "abcde"
  </script>

However, it is considered a security risk which is why it is no longer
enabled by default.  Plus, it will only work on systems that have it
installed.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list