470,815 Members | 1,427 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Using a browser as a GUI: which Python package

First, an apology: I realise that I don't know enough about what I am
asking to make sure to use the proper language to phrase my question.

I would like to use a browser (e.g. Firefox) as a simple GUI
"framework". Note that this is to be done on a single user machine, so
the question of sandboxing is not really relevant here.

The simplest application I would like to start with would be one with
two "windows" (within a browser window) and a single button. One
window would be used as a Python code editor; the other as an output
window. On clicking on the button, the code in the editor window would
be run by Python with the result appearing in the output window.

[A more advanced, future version, would be to have Python create some
graphical code (e.g. SVG) that could be passed to the browser to be
displayed within the output window.]

Ideally, I would prefer a Python-based solution only.

My ultimate goal would be to port the main features of two
wxPython-based apps I wrote (rur-ple and Lightning Compiler, both found
at https://sourceforge.net/project/show...roup_id=125834)
within a standard browser.

Any help/pointers would be appreciated.

André

Apr 28 '06 #1
7 2217
"André" <an***********@gmail.com> wrote:
First, an apology: I realise that I don't know enough about what I am
asking to make sure to use the proper language to phrase my question.

I would like to use a browser (e.g. Firefox) as a simple GUI
"framework". Note that this is to be done on a single user machine, so
the question of sandboxing is not really relevant here.

The simplest application I would like to start with would be one with
two "windows" (within a browser window) and a single button. One
window would be used as a Python code editor; the other as an output
window. On clicking on the button, the code in the editor window would
be run by Python with the result appearing in the output window.

[A more advanced, future version, would be to have Python create some
graphical code (e.g. SVG) that could be passed to the browser to be
displayed within the output window.]

Ideally, I would prefer a Python-based solution only.


I guess you need at least AJAX to make it smooth. (Otherwise if you press
the button, your window is refreshed.)

But other then that: a form with text area + submit button, and a result
part should do the trick. If you want a "real" editor a lot of JavaScript
it needed to make it work.

Also note that if your result takes some time you need to send dummy
headers every now and then to keep the connection alive. And even then
there might be problems with time outs.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Apr 29 '06 #2

John Bokma wrote:
"André" <an***********@gmail.com> wrote: [snip]

I would like to use a browser (e.g. Firefox) as a simple GUI
"framework". Note that this is to be done on a single user machine, so
the question of sandboxing is not really relevant here.
[snip]
Ideally, I would prefer a Python-based solution only.


I guess you need at least AJAX to make it smooth. (Otherwise if you press
the button, your window is refreshed.)

But other then that: a form with text area + submit button, and a result
part should do the trick. If you want a "real" editor a lot of JavaScript
it needed to make it work.

Also note that if your result takes some time you need to send dummy
headers every now and then to keep the connection alive. And even then
there might be problems with time outs.


I don't see why I would have problems with timeouts. As I mentioned
(briefly) I want to use this on a single machine i.e. no communication
over the web. Something like htconsole
(http://blog.ianbicking.org/introducing-htconsole.html). I could use
htconsole and the packages it uses as a starting point, but I would
feel that it would be like choosing to use Tkinter for graphics after
seeing a single GUI based app. Before I invest some time in this, I'd
like to have an idea of what the options are.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html


Apr 29 '06 #3
"André" <an***********@gmail.com> wrote:
John Bokma wrote:
Also note that if your result takes some time you need to send dummy
headers every now and then to keep the connection alive. And even
then there might be problems with time outs.


I don't see why I would have problems with timeouts. As I mentioned
(briefly) I want to use this on a single machine i.e. no communication
over the web.


You use Python for the webserver as well? Then there might be no problem.
But otherwise, Apache has a max time a script is allowed to run before
it's killed. Of course you can increase that time.

As for the dummy headers, AFAIK still needed, otherwise the browser might
give up.
Something like htconsole
(http://blog.ianbicking.org/introducing-htconsole.html). I could use
htconsole and the packages it uses as a starting point, but I would
feel that it would be like choosing to use Tkinter for graphics after
seeing a single GUI based app. Before I invest some time in this, I'd
like to have an idea of what the options are.


I am quite new to Python, but have some idea of the other things you
probably require :-)

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Apr 29 '06 #4
Problem solved using CherryPy.

See http://aroberge.blogspot.com/2006/04...-is-great.html for the
details.

Apr 29 '06 #5
"André" <an***********@gmail.com> writes:
[...]
I would like to use a browser (e.g. Firefox) as a simple GUI
"framework". Note that this is to be done on a single user machine, so
the question of sandboxing is not really relevant here. [...] My ultimate goal would be to port the main features of two
wxPython-based apps I wrote (rur-ple and Lightning Compiler, both found
at https://sourceforge.net/project/show...roup_id=125834)
within a standard browser.


If you can stick to Firefox, you might find XUL useful. There are
various different styles of development that use XUL and Python -- a
bit of Googling and reading should find them.
John

Apr 29 '06 #6
John J. Lee wrote:
"André" <an***********@gmail.com> writes:
[...]
I would like to use a browser (e.g. Firefox) as a simple GUI
"framework". Note that this is to be done on a single user machine, so
the question of sandboxing is not really relevant here.


[...]
My ultimate goal would be to port the main features of two
wxPython-based apps I wrote (rur-ple and Lightning Compiler, both found
at https://sourceforge.net/project/show...roup_id=125834)
within a standard browser.

If you can stick to Firefox, you might find XUL useful. There are
various different styles of development that use XUL and Python -- a
bit of Googling and reading should find them.

Bear in mind that I don't know what I am talking about, but I stumbled
across 'ZK' the other day put it on my list of thinkgs to check out. It
provides a range of XUL and XHTML widgets, see:

http://zk1.sourceforge.net/

Has anyone tried this? I would really like to find a GUI toolkit that
allowed me to program XUL in Firefox using Python. ZK is not quite
that, but it looks close.

Don.

May 1 '06 #7
I am looking for the samething. I was thinking of Karrigell.

http://karrigell.sourceforge.net/

May 1 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Kenneth McDonald | last post: by
36 posts views Thread by peter.mosley | last post: by
8 posts views Thread by diffuser78 | last post: by
reply views Thread by André | last post: by
29 posts views Thread by 63q2o4i02 | last post: by
4 posts views Thread by Anastasios Hatzis | last post: by
31 posts views Thread by sdoty044 | last post: by
9 posts views Thread by Todd Whiteman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.