component / event based web framework for python?

J

Jaime Barciela

Hello all,

I've been surveying the field of python web frameworks for a while but
there are just too many so I ask mighty Usenet.

Is there a component / event based web framework for python? Something
that can abstract you from the request/response mechanism and ideally
from html and javascript altogether?

As examples -- in other languages -- of what I have in mind:
- in java: wingS, GWT, echo (2,3), karora, thinwire, itmill, and
maybe others
- in javascript: cappuccino
- in lisp: weblocks
- in smalltalk: seaside, aida/web
- in .net: asp.net

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 !!!";
}
}
}
============

Thanks
Jaime
 
D

Diez B. Roggisch

Jaime said:
Hello all,

I've been surveying the field of python web frameworks for a while but
there are just too many so I ask mighty Usenet.

Is there a component / event based web framework for python? Something
that can abstract you from the request/response mechanism and ideally
from html and javascript altogether?

You might consider taking a look at tosca-widgets, which are used to
create re-usable components of javascript, css and html. They can be
used in any WSGI-capable environment, but TurboGears and Pylons are best
known for incorporating them.

http://toscawidgets.org/documentation/

Diez
 
L

lkcl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top