Popularising wxPython

Creating a page in wiki is itself a pain. I have a codebase where I
store my small parts of code (Let say I'm testing some functionalities
of wx.ListCtrl). It would be great to have something easy like
worpress special for codes only. Then make categories during making
code posts.
Wordpress is zillions easier than currently wiki CMS.

wxWidgets uses Wikimedia's CMS. I don't know how difficult it is, but
I think it is time for Robin and the crew to make use of easier CMS.
By doing so, many will contibute.

Anyway how about wxPython for python 3
Starting discussing it at least, would be good.

···

On Sep 15, 9:22 pm, C M <cmpyt...@gmail.com> wrote:

On Tue, Sep 15, 2009 at 1:26 PM, Don Dwiggins <ddwigg...@advpubtech.com> wrote:

> C M wrote:

>> Online demos? A real *demo*, meaning you could interact with the controls,
>> would be a lot of work--it would really be a translation of wxpython into
>> javascript, thereby making a web-based way to do wxPython. That would
>> be great, and maybe could be done using pyjamas or something, but I would
>> think it would be a major thing to pull off (though certainly welcome).

> I agree with both parts of the last sentence. I've written several
> wxPython apps, and am now up to my elbows in a web app using ExtJS for
> the browser side. What follows is essentially a bit of fantasizing on
> my part about how something roughly like ExtJs could become the "native
> widgets" wrapped by wxWidgets/wxPython. If the subject interests you,
> follow along, otherwise skip it.

> I'll focus on ExtJs because that's the broswer-side application
> framework I'm familiar with. The normal interaction between an ExtJs app
> and the "back end" (database, middle tier, filesystem, or whatever) is
> via Ajax requests; in effect, the framework code usually maintains
> control of the user interface, even though asynchronously.

> So, let's imagine that ExtJs components mapped cleanly to wx widgets.
> We could define a set of Ajax requests corresponding to the ExtJs
> component APIs, and on the server side, map these to the wx widgets.
> This mapping would be done by a framework or library, which could be
> embedded in a web server (or an application that, under the covers,
> includes a server that handles the needed HTTP/Ajax requests.

> Don't take the last paragraph too seriously -- it's a gross
> oversimplification of what would really have to be done, and it's full
> of holes. I'm sort of using ExtJs here as an "existence proof".
> If someone were to undertake this, they'd probably create a JS
> infrastructure that implements something closer to the wx API, with the
> intent that an application developer would write little, if any JS.

> Maybe the best way to think of this is by analogy to the X Window
> system, where the application communicates with its GUI via a remote
> protocol, and the GUI lives in an X window server. In this case, the
> "window server" would the browser, and the communication protocol would
> be wx-specific, but based on XHR.

> Someone undertaking this would likely run into issues that would be hard
> to resolve cleanly, arising from the serious differences between an
> application running in an OS, interacting with the user via the
> OS-supplied GUI, and an application interacting via a browser over HTTP.

> It might be necessary to give up on the "platform independent" goal --
> wx application developers would have to deal with this "target platform"
> differently. Perhaps its real utility would lie in the ability for an
> experienced wx app developer to use most of what he already knows in
> writing his first web app, and in easing the task of migrating a
> wx-based desktop app to a web environment.

I definitely do not know Ajax and such to fully understand this, and
I am highly likely to utter something nonsensical here, but let me
jump in anyway...

Maybe I can comment on the last point. I'm not sure why this
"platform" would require dealing with it differently, provided the
mapping from wxPython widgets to the wxPython-in-a-browser
widgets was good enough. E.g., with a wxComboBox, one
should be able to write a regular comboBox in wxPython and
the new approach would know how to draw the comboBox in the
browser, and do the animation of the dropdown, and such.
It seems like what could be good would be a way to "translate"
or compile wxPython code to something like Javascript.
That's why I mentioned Pyjamas, because it is a Python-to-
Javascript compiler, and has its own widget set and AJAX
framework. I could imagine a wxPython-API-to-Pyjamas-widgets
approach, too, such that maybe one could write a regular
wxPython app for the desktop and there could be some way
to automatically allow that to run and create a GUI on a browser,
with the calls to the server being intelligently routed by Pyjamas.
I haven't even tried to use Pyjamas, though, so what I am
spouting here may be totally off base.

Che

<snip>

interesting ideas !

After using wxPython for a couple of years,
I'm now experimenting with PyJamas.
Browser based applications will probably become more and more important in the near future

I'm thinking of the following concept:
1- build and test my application in wxPython
2- translate the wxPython application to PyJamas (and test it further in the different browsers)

I'm not yet familiar enough with PyJamas,
and I'm a great optimist,
so I've the feeling the base of such a translator can be build in a couple of weeks.

cheers,
Stef

Well, that does sound pretty optimistic :smiley: I think people on the list
would enjoy hearing about your experiences as you experiment with it.

Che

···

On Tue, Sep 15, 2009 at 6:25 PM, Stef Mientki <stef.mientki@gmail.com> wrote:

<snip>

interesting ideas !

After using wxPython for a couple of years,
I'm now experimenting with PyJamas.
Browser based applications will probably become more and more important
in the near future

I'm thinking of the following concept:
1- build and test my application in wxPython
2- translate the wxPython application to PyJamas (and test it further in
the different browsers)

I'm not yet familiar enough with PyJamas,
and I'm a great optimist,
so I've the feeling the base of such a translator can be build in a
couple of weeks.

It's actually not too wild of an idea, and has been discussed a couple times in wxWidgets conversations for things like potential GSoC projects, etc. Nothing much has come of it yet, but it is certainly an idea that others are having too. Personally I think that Python (or maybe Python plus C++) would be a much better fit for this than C++ alone, and maybe if somebody approached it from that direction they might get a lot further than just dreaming about it.

···

On 9/15/09 10:26 AM, Don Dwiggins wrote:

C M wrote:

Online demos? A real *demo*, meaning you could interact with the controls,
would be a lot of work--it would really be a translation of wxpython into
javascript, thereby making a web-based way to do wxPython. That would
be great, and maybe could be done using pyjamas or something, but I would
think it would be a major thing to pull off (though certainly welcome).

I agree with both parts of the last sentence. I've written several
wxPython apps, and am now up to my elbows in a web app using ExtJS for
the browser side. What follows is essentially a bit of fantasizing on
my part about how something roughly like ExtJs could become the "native
widgets" wrapped by wxWidgets/wxPython.

--
Robin Dunn
Software Craftsman

I'm out of my depth here, but I was wondering why there couldn't be an
wx/Python applet, program, deamon, plugin, browser plugin, whatever
you want to call it, that runs just like the Java "plugin" but instead
of Java, wx/Python.

On my MS Windows, I had to install a Sun Java program to run Java
applets when using my browser. Instead, how about installing a wx/
Python program that works just like that but instead of Java/script
code with wx/Python code. Why bother to convert it to some other
langauge like Java, JavaScript or C# or whatever.

Why does it have to be converted to any other langauge like Java? Just
to use the Java engine. Bah, we need a wx/Python engine that replaces
Java completely. The Python compiler tokenizes/byte codes the source
already. Wouldn't that Python byte code be what is passed between
server and "client" over the Internet. Or just as Java is?

I really don't know what I'm talking about here. But when I see source
code of another language, I wonder why Python source couldn't just as
easily suffice in it's place - for the most part pretty much for any
task excluding security tasks. (I'm aware of Python speed issues.)

As far as I'm concerned, I'd prefer to see all source code as Python
source instead of C++ source based on visual appearence and
understandability of code syntax alone. I'd even love to see most of
an OS coded in Python, and only the security kernal in C++.

I'm just shooting out an obsure idea, wasn't looking for any
responses. This response was kinda also linking my thoughts with nipun
batra's initial post of Popularizing wxPython.

Devplayer

···

On Sep 15, 8:36 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 9/15/09 10:26 AM, Don Dwiggins wrote:

> C M wrote:

>> Online demos? A real *demo*, meaning you could interact with the controls,
>> would be a lot of work--it would really be a translation of wxpython into
>> javascript, thereby making a web-based way to do wxPython. That would
>> be great, and maybe could be done using pyjamas or something, but I would
>> think it would be a major thing to pull off (though certainly welcome).

> I agree with both parts of the last sentence. I've written several
> wxPython apps, and am now up to my elbows in a web app using ExtJS for
> the browser side. What follows is essentially a bit of fantasizing on
> my part about how something roughly like ExtJs could become the "native
> widgets" wrapped by wxWidgets/wxPython.

It's actually not too wild of an idea, and has been discussed a couple
times in wxWidgets conversations for things like potential GSoC
projects, etc. Nothing much has come of it yet, but it is certainly an
idea that others are having too. Personally I think that Python (or
maybe Python plus C++) would be a much better fit for this than C++
alone, and maybe if somebody approached it from that direction they
might get a lot further than just dreaming about it.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

Ed Leafe talked a little bit on this topic (kind of) at PyCon 2009:

http://us.pycon.org/2009/conference/schedule/event/58/

I thought it was pretty cool.

By the way, plugins for Firefox are written in javascript or XUL or a
combination of the two. There used to be a project that would allow
Python to run in Firefox too, but it's been dead for quite a while.

IronPython has good support for Python in the browser though...but
it's through Silverlight, which seems to be a dirty word in FOSS
circles.

···

On Sep 17, 11:01 am, DevPlayer <devpla...@gmail.com> wrote:

On Sep 15, 8:36 pm, Robin Dunn <ro...@alldunn.com> wrote:

> On 9/15/09 10:26 AM, Don Dwiggins wrote:

> > C M wrote:

> >> Online demos? A real *demo*, meaning you could interact with the controls,
> >> would be a lot of work--it would really be a translation of wxpython into
> >> javascript, thereby making a web-based way to do wxPython. That would
> >> be great, and maybe could be done using pyjamas or something, but I would
> >> think it would be a major thing to pull off (though certainly welcome).

> > I agree with both parts of the last sentence. I've written several
> > wxPython apps, and am now up to my elbows in a web app using ExtJS for
> > the browser side. What follows is essentially a bit of fantasizing on
> > my part about how something roughly like ExtJs could become the "native
> > widgets" wrapped by wxWidgets/wxPython.

> It's actually not too wild of an idea, and has been discussed a couple
> times in wxWidgets conversations for things like potential GSoC
> projects, etc. Nothing much has come of it yet, but it is certainly an
> idea that others are having too. Personally I think that Python (or
> maybe Python plus C++) would be a much better fit for this than C++
> alone, and maybe if somebody approached it from that direction they
> might get a lot further than just dreaming about it.

> --
> Robin Dunn
> Software Craftsmanhttp://wxPython.org

I'm out of my depth here, but I was wondering why there couldn't be an
wx/Python applet, program, deamon, plugin, browser plugin, whatever
you want to call it, that runs just like the Java "plugin" but instead
of Java, wx/Python.

On my MS Windows, I had to install a Sun Java program to run Java
applets when using my browser. Instead, how about installing a wx/
Python program that works just like that but instead of Java/script
code with wx/Python code. Why bother to convert it to some other
langauge like Java, JavaScript or C# or whatever.

Why does it have to be converted to any other langauge like Java? Just
to use the Java engine. Bah, we need a wx/Python engine that replaces
Java completely. The Python compiler tokenizes/byte codes the source
already. Wouldn't that Python byte code be what is passed between
server and "client" over the Internet. Or just as Java is?

I really don't know what I'm talking about here. But when I see source
code of another language, I wonder why Python source couldn't just as
easily suffice in it's place - for the most part pretty much for any
task excluding security tasks. (I'm aware of Python speed issues.)

As far as I'm concerned, I'd prefer to see all source code as Python
source instead of C++ source based on visual appearence and
understandability of code syntax alone. I'd even love to see most of
an OS coded in Python, and only the security kernal in C++.

I'm just shooting out an obsure idea, wasn't looking for any
responses. This response was kinda also linking my thoughts with nipun
batra's initial post of Popularizing wxPython.

Devplayer

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

DevPlayer wrote:

I'm out of my depth here, but I was wondering why there couldn't be an
wx/Python applet, program, deamon, plugin, browser plugin, whatever
you want to call it, that runs just like the Java "plugin" but instead
of Java, wx/Python.

There certainly could be, and it's been talked about for years, but no on e has gotten around to writing it. This is why I think that is:

On my MS Windows, I had to install a Sun Java program to run Java
applets when using my browser.

Yes, and wasn't that a pain in the ^%#@? Java applets on the web have been a pain for years, and are a dying technology now, and I think it's exactly because of the darn plug-in installation needs.

On the other hand, Flash is used a lot, and it requires a plug-in. Maybe Sun just never got the whole install/version management thing going well. Or Flash is cool enough and makes it easy enough to do nifty things that people want to use it -- who wants to write JAVA? :wink:

What's great about AJAX is that you can write apps that are pretty full featured and responsive and will run in the major browsers out of the box.

That being said -- the AJAX programming paradigm is inherently different than wxPython. It is be definition client server. What that means is that for any given bit of functionality you need to decide where you want to put it -- int he browser, in JavaScript, or on t eh server, accesses with an AJAX call.

This is no big deal for really simple things, like a combo box, but I know when I write wxPython code, I almost always end up writing custom GUI classes - I subclass from an existing widget and add functionality. In the AJAX case, that subclassing and custom added code would probably have to be written in Javascript (or generated JavaScript, I suppose)

The way to think about it is what would all your callbacks do? For every event you bind, you need to decide if that's a call to the server, or to internal JavaScript code.

I think this kind of dual Web-app/desktop app development would work best if you wrote the app with the web in mind, rather than the desktop. Then, if the desktop versions, the "in-browser" and "server" calls would all run in the same place, but no harm done.

I suspect this is how Pyjamas works.

So in a way, I'm guess I'm suggesting a JavaScript(and AJAX kit: Dojo, extJS, whatever) to wxPython translator, rather than the other way around.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

On my MS Windows, I had to install a Sun Java program to run Java
applets when using my browser.

Yes, and wasn't that a pain in the ^%#@? Java applets on the web have
been a pain for years, and are a dying technology now, and I think it's
exactly because of the darn plug-in installation needs.

On the other hand, Flash is used a lot, and it requires a plug-in. Maybe
Sun just never got the whole install/version management thing going
well. Or Flash is cool enough and makes it easy enough to do nifty
things that people want to use it -- who wants to write JAVA? :wink:

I agree with this. I've been developing an extensive web application the last months (with ms asp.net) and one of the major requirements in the beginning was "only browser needs to be present on user's system". Anything else wouldn't probably get past the firewall. The firewall even killed the connection when sending more than 1k data in an XmlHttpRequest. Company pcs often don't have flash installed as well (at least the ones I was concerned with).
So my application is founded around html and ajax.

What's great about AJAX is that you can write apps that are pretty full
featured and responsive and will run in the major browsers out of the box.

Exactly. And they look better than native widgets, too (imo). They can also be very powerful. E.g. http://www.telerik.com/ . With the newest flash things you can also do surprisingly good applications.

That being said -- the AJAX programming paradigm is inherently different
than wxPython. It is be definition client server. What that means is
that for any given bit of functionality you need to decide where you
want to put it -- int he browser, in JavaScript, or on t eh server,
accesses with an AJAX call.

Yes, you cannot expect your desktop application to magically run as a web app. It forces you to separate state from ui and such very strictly (which is a good thing imo).

This is no big deal for really simple things, like a combo box, but I
know when I write wxPython code, I almost always end up writing custom
GUI classes - I subclass from an existing widget and add functionality.
In the AJAX case, that subclassing and custom added code would probably
have to be written in Javascript (or generated JavaScript, I suppose)

I also agree with this strongly. It's one thing to wrap the most common controls. But it's another thing getting your custom widgets running over the net. That can get quite painful work.

The way to think about it is what would all your callbacks do? For every
event you bind, you need to decide if that's a call to the server, or to
internal JavaScript code.

A lot of times you need to write code for both sides. E.g. you can validate things on the client side very quickly and give visual feedback as the user enters things, but it has also to be checked again on the server side for security reasons.

I think this kind of dual Web-app/desktop app development would work
best if you wrote the app with the web in mind, rather than the desktop.
Then, if the desktop versions, the "in-browser" and "server" calls would
all run in the same place, but no harm done.

Yes.

I suspect this is how Pyjamas works.

So in a way, I'm guess I'm suggesting a JavaScript(and AJAX kit: Dojo,
extJS, whatever) to wxPython translator, rather than the other way around.

What I am using for "rich webapps" since a few years is wxPython + twisted pb + [event framework of your choice (e.g. wx.lib.pubsub, pydispatcher, ...)]. Twisted pb is probably not the best tool, but it works. I can synchronize state between different clients through a server just fine. The wx ui updates accordingly. This allows you to do very rich, interactive, multi-user apps.
One important aspect to consider is also that webapps are different. E.g. my webapp does not use a lot of those standard combobox controls etc, like typical DB interfacing webapps do. I couldn't have written this application with e.g. ms asp .net. And I very much doubt I could write it with the dabo automatic webframework stuff.
So different application demands need different solutions. The reason why something like "wxPython for Web" does not exist to this date is imo that you have to invest a lot of work into making the common things easy to do over web. When you have all that done, you realize that ajax/html frameworks can do the same. You'll also realize you cannot write arbitrary webapps with "wxPython for Web" without lots of custom, individual work.

-Matthias

···

Am 17.09.2009, 20:52 Uhr, schrieb Christopher Barker <Chris.Barker@noaa.gov>: