473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 2342
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kenneth McDonald | last post by:
If this is not an appropriate newsgroup for this type of posting, please let me know and (if possible) suggest an alternative. I've done a fair bit of research on the net, but information is...
36
by: peter.mosley | last post by:
I am trying to learn GUI programming in Python, but have to confess I am finding it difficult. I am not an experienced programmer - just someone who from time to time writes small programs for...
8
by: diffuser78 | last post by:
Hi, I am a python newbie and have used it for about a month. I want to make a simple GUI app in Python ( I take input form user and do processing and show results). Which gui package is good...
0
by: André | last post by:
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...
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
32
by: Kevin Walzer | last post by:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python, in part because Python has better support for certain kinds of applications that I want to develop than Tcl/Tk does....
4
by: Anastasios Hatzis | last post by:
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool ("foo") by accessing some kind of API. Actually I have the need for such pattern for...
31
by: sdoty044 | last post by:
Just wondering on what peoples opinions are of the GUIs avaiable for Python? All I am doing is prompting users for some data (listbox, radio buttons, text box, ect...). Then I will have some...
9
by: Todd Whiteman | last post by:
I've put together a tutorial that shows off how to build a GUI application using XULRunner (same architectural components as Firefox uses) that can be used in conjunction with the Python...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.