一个python 的AJX 东东!

2009-05-13 05:35:12来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

一个python 的AJX 东东!
网站是:
http://pyjamas.pyworks.org/
Many people, when first finding out about
Google Web Toolkit
, wonder "why can't I use Python instead of Java?". pyjamas is designed to make that possible. And we're drawing heavily from Google's work.
It's in its early stages but I invite anyone who is interested to join the mailing list and check out what's in the Subversion repository.
You'll see py-gwt referenced. That's just because that's what I was calling it before a better name came along. jorjun came up with pyjamas. We're still working on backworking an acronym for it that I like :-)


  • Download


  • Trac


  • Mailing list


  • Subversion Repository


  • Examples

  • IRC: #pyjamas on freenode

for django :
Using pyjams with Django is very straightforward, this is how I did it.
PyJamas code for the UI:
from ui import RootPanel, TextArea, Label, Button, HTML, VerticalPanel
from JSONService import JSONProxy
class DjangoTest:
    def onModuleLoad(self):
        self.TEXT_WAITING = "Waiting for response..."
        self.TEXT_ERROR = "Server Error"
        self.remote = EchoService()
        self.status=Label()
        self.text_area = TextArea()
        self.button = Button("Send text to Echo Service", self)
        self.button2 = Button("Send text to Echo Service 2", self)
        panel = VerticalPanel()
        panel.add(HTML("JSON-RPC Example"))
        panel.add(self.text_area)
        panel.add(self.button)
        panel.add(self.button2)
        panel.add(self.status)
        RootPanel().add(panel)
    def onClick(self, sender):
        self.status.setText(self.TEXT_WAITING)
        if sender == self.button:
            id = self.remote.echo(self.text_area.getText(), self)
        else:
            id = self.remote.echo2(self.text_area.getText(), self)

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:chapter5 strings

下一篇:Fail to enable httpready Accept Filter