473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2354
"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
2270
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 scattered all over the place and I haven't been able to find mailing lists relating specifically to python and UIs. I'd like to start using Python for...
36
4099
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 my use. Over the years I have moved from GWBASIC to QBASIC to Visual Basic, and now trying to move across to a Linux platform. Python seems to be...
8
1355
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 for me. I need to do it quick and I would not want a long learning curve. I was taking look at wxPython, pyGTK etc.
0
305
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 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...
29
16486
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 I *want* at the end of this; I just have never taken on a programming task of this magnitude. I've seen that some are using python as a utility...
32
7460
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. Naturally, I thought that I would use Tkinter as the GUI for these programs. However, in doing research into GUI development techniques, sample code, and...
4
2369
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 my own tool (http://openswarm.sourceforge.net). I already started restructuring my code to separate the actual command implementations from the...
31
2458
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 text output, maybe a scrolling text message as things are happening. I have some minor things I need to do, for example, if Checkbutton X is...
9
3053
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 programming language. The tutorial covers how to build a Python/XULRunner GUI application:...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8216
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.