component / event based web framework for python?

Discussion in 'Python' started by Jaime Barciela, Sep 15, 2008.

  1. 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
    Jaime Barciela, Sep 15, 2008
    #1
    1. Advertising

  2. Jaime Barciela schrieb:
    > 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
    Diez B. Roggisch, Sep 15, 2008
    #2
    1. Advertising

  3. Jaime Barciela

    lkcl Guest

    On Sep 15, 4:53 pm, Jaime Barciela <> 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.
    lkcl, Oct 10, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. markla
    Replies:
    1
    Views:
    531
    Steven Cheng
    Oct 6, 2008
  2. Tony Arcieri
    Replies:
    1
    Views:
    123
    Roger Pack
    Feb 2, 2009
  3. Tony Arcieri
    Replies:
    0
    Views:
    184
    Tony Arcieri
    Oct 15, 2009
  4. Diego Bernardes
    Replies:
    2
    Views:
    135
    RichardOnRails
    Oct 26, 2009
  5. Tony Arcieri
    Replies:
    14
    Views:
    440
    Tony Arcieri
    Dec 9, 2010
Loading...

Share This Page