component / event based web framework for python?

lkcl luke.leighton at googlemail.com
Fri Oct 10 08:02:19 EDT 2008


On Sep 15, 4:53 pm, Jaime Barciela <jbarci... at gmail.com> wrote:
> Hello all,
>
> I've been surveying the field ofpythonweb frameworks for a while but
> there are just too many so I ask mighty Usenet.
>
> Is there a component / event based web framework forpython? Something
> that can abstract you from the request/response mechanism and ideally
> from html and javascript altogether?

 yep.  Pyjamas.  http://pyjs.org

 in fact, it's _so_ abstracted from html and javascript that i ported
pyjamas to the desktop, using python bindings to glib bindings to
webkit - see http://webkit.org or better:

   http://pyjd.org


> As examples -- in other languages -- of what I have in mind:
>     - in java: wingS,GWT, echo (2,3), karora, thinwire, itmill,

  Pyjamas is a port of GWT to python.

> I would like to be able to write code equivalent to this C# example:
>
> ============
> namespace WebApplication1
> {
>     public partial class _Default : System.Web.UI.Page
>     {
>         protected void Page_Load(object sender, EventArgs e)
>         {
>             Button b = new Button();
>             b.Text = "say hello";
>             b.Click += Button1_Click;
>             Panel1.Controls.Add(b);
>         }
>
>         protected void Button1_Click(object sender, EventArgs e)
>         {
>             Label1.Text = "Hello dynamically created on the fly
> UI !!!";
>         }
>     }}

how about this:

   from pyjamas import Window
   from pyjamas.ui import Button, RootPanel

   def greet(sender):
       Window.alert("Hello, AJAX!")

   class Hello:
       def onModuleLoad(self):
           b = Button("Click me", greet)
           RootPanel().add(b)

is that close enough? :)  does it look _remotely_ like javascript,
html, or even like it's web programming?  doesn't it remind you of
pygtk2 rather a lot? :)

more working examples at http://pyjs.org/examples/

l.




More information about the Python-list mailing list