473,468 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Building a Python app with Mozilla

Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).

Komodo itself is an excellent example of a - at least Python driven -
application that looks superb and has superior functionality so it
seems natural to use the Komodo approach for me.

Some questions

* Is there a simple How-To how to build a very simple (Python) app
with the Mozilla framework? Kind of "Hello world"...?

* Is is reasonable to think that building a GUI with Mozilla is easier
than using Python frameworks because Mozilla does most of the GUI
work?
Thorsten
Jun 29 '07 #1
20 2588
Thorsten Kampe wrote:
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).
You apparently didn't look very hard. On the wxPython end of things
(which I have experience with), there is wxGlade, XRCed, Boa
Constructor, Dabo, etc. I don't know about Tkinter (I don't use it),
but I know that at least Qt has a very nice GUI designer and builder
(from Trolltech if you are willing to pay for it), and if I remember
correctly, Eric4 offers some tools to make PyQt editing nice and
friendly. I'm sure there are others.

As for wxPython applications not looking good on all platforms; I hate
to break it to you, but the majority of the controls are *native* on
whatever platform you happen to be using (except for Qt-based frontends
in *nix, wxPython uses a Gtk binding in *nix). Take a browse through a
few of the applications listed in the wiki:
http://wiki.wxpython.org/wxPythonPit_Apps , or even Andrea Gavana's
custom widgets http://xoomer.alice.it/infinity77/eng/freeware.html .

Komodo itself is an excellent example of a - at least Python driven -
application that looks superb and has superior functionality so it
seems natural to use the Komodo approach for me.
I could have sworn that Komodo was written in PyQt. Unless my memory is
failing me (doubtful, as they at least used to offer some PyQt
development tools), I would imagine they merely embedded the mozilla
bits and pieces with some C extensions.

In any case, you really don't want to be developing an application using
XPI. According to everyone I've ever talked to about XPI, while getting
the basic stuff working isn't bad, doing anything worth mentioning is
about as big a pain in the butt than just writing everything in 8088
assembly. You mileage may vary of course.

* Is there a simple How-To how to build a very simple (Python) app
with the Mozilla framework? Kind of "Hello world"...?
Maybe. Search terms you should use are 'embed XPI python', which give
me about 189k results in google, some of which seem applicable on the
first page (which also leads me to believe that my statements regarding
Komodo embedding mozilla technology may be right, though maybe they
wrote Komodo in C and Qt).

* Is is reasonable to think that building a GUI with Mozilla is easier
than using Python frameworks because Mozilla does most of the GUI
work?
Doubtful. Building a GUI app with XRCed and wxPython is pretty easy if
you understand Python and object-oriented programming. There are some
annoying vagaries with events, but if you ask your questions on the
wxpython-users mailing list (over at wxpython.org), one of at least a
half-dozen people will likely answer your question.
- Josiah
Jun 30 '07 #2
You apparently didn't look very hard. On the wxPython end of things
(which I have experience with), there is wxGlade, XRCed, Boa
Constructor, Dabo, etc. I don't know about Tkinter (I don't use it),
but I know that at least Qt has a very nice GUI designer and builder
(from Trolltech if you are willing to pay for it), and if I remember
correctly, Eric4 offers some tools to make PyQt editing nice and
friendly. I'm sure there are others.
You're somewhat wrong regarding Qt. The designer is free (I did never
use a commercial Qt, maybe there comes something additional - but IF I
don't have the faintest idea what it could do that would make it better
than the free designer.)

And eric is cool and integrates with Qt (and is an example of a Qt-app
itself), via launching the designer - but it hasn't have any
gui-building stuff in there.

Diez
Jun 30 '07 #3
Thorsten Kampe schrieb:
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).
The latter statement is bogus. Qt is THE native look on KDE. GTK for
Gnome. So how is it not "looking good on linux"?

And as it has been said in this thread already, Qt has an excellent free
GUI-builder.

Diez
Jun 30 '07 #4
[ "Diez B. Roggisch" <de***@nospam.web.de]
And as it has been said in this thread already, Qt has an excellent free
GUI-builder.
Free as long as you develop free software. Development of proprietary,
non-gpl software with Qt requires a commercial licence from Trolltech.

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)

iD8DBQBGhj8qn3IEGILecb4RAlXPAJ0QjaG0CpKAr9uz7diDGh v6BEPLfACeN63U
bWL/mJWyqO940cQg9uzawVw=
=u938
-----END PGP SIGNATURE-----

Jun 30 '07 #5
Thorsten Kampe wrote:
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).

Komodo itself is an excellent example of a - at least Python driven -
application that looks superb and has superior functionality so it
seems natural to use the Komodo approach for me.
Komodo is not a Python application. It is a Mozilla application that
supports Python development. Komodo is more akin to Thunderbird and
Firefox than anything else; it uses the XUL framework for rendering
widgets, if I'm not mistaken. If you want to build an application like
Komodo, get a book on developing with the Mozilla framework (XUL, XPCOM,
and all that) and look at that. Python has little to do with that.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Jun 30 '07 #6
Sebastian Wiesner schrieb:
[ "Diez B. Roggisch" <de***@nospam.web.de]
>And as it has been said in this thread already, Qt has an excellent free
GUI-builder.

Free as long as you develop free software. Development of proprietary,
non-gpl software with Qt requires a commercial licence from Trolltech.
The OP did debuke Qt because of a lack of a gui-builder, not because of
it's licensing.

Diez
Jun 30 '07 #7
[ "Diez B. Roggisch" <de***@nospam.web.de]
I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).

The latter statement is bogus. Qt is THE native look on KDE. GTK for
Gnome. So how is it not "looking good on linux"?
I guess, "not looking good on linux" refers to Tkinter, which is in fact
really ugly on linux systems.
And as it has been said in this thread already, Qt has an excellent free
GUI-builder.
So have Gtk and WxWidgets.

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)

iD8DBQBGho+Yn3IEGILecb4RAvRzAJwIp/lzT8O/4WwYUU/RxFQztwSUXgCdHPPZ
X/PbnLvKbNZHbcwcQowhnxM=
=+nm1
-----END PGP SIGNATURE-----

Jun 30 '07 #8
Kevin Walzer wrote:
Komodo is not a Python application. It is a Mozilla application that
supports Python development. Komodo is more akin to Thunderbird and
Firefox than anything else; it uses the XUL framework for rendering
widgets, if I'm not mistaken. If you want to build an application like
Komodo, get a book on developing with the Mozilla framework (XUL, XPCOM,
and all that) and look at that. Python has little to do with that.
Most application logic in Komodo is implemented in Python, using the
PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The
editor is Scintilla (C++).

.../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc
....
....
126392 456858 4949602 total

This doesn't include the python code in the Python libraries themselves.

Cheers,
Brian
Jun 30 '07 #9
Thorsten Kampe wrote:
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.
Hi Thorsten,

I'm sorry that we (Komodo team) missed it, but I did not see such a
message on the Komodo mailing list.
>
I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).

Komodo itself is an excellent example of a - at least Python driven -
application that looks superb and has superior functionality so it
seems natural to use the Komodo approach for me.

Some questions

* Is there a simple How-To how to build a very simple (Python) app
with the Mozilla framework? Kind of "Hello world"...?
Just to detail how Komodo works, as there seems to be some confusion on
this:
* Komodo is based on top of Mozilla (like Firefox, Thunderbird,
Democracy, etc... )
* Komodo includes PyXPCOM (XPCOM bindings to the Python language), which
enables JavaScript and C++ components to easily interact with python
objects inside an embedded Python.
* The Komodo UI is written using XUL/JavaScript and most of the backend
services are written using Python code.

To enable the use of Python from within the Mozilla framework you'll
need to build mozilla with the python xpcom extension enabled.

For a simple overview of building and making use of PyXPCOM, see these
links:
* http://developer.mozilla.org/en/docs/PyXPCOM
* http://developer.mozilla.org/en/docs/Building_PyXPCOM
* http://developer.mozilla.org/en/docs...PCOM_component
* Is is reasonable to think that building a GUI with Mozilla is easier
than using Python frameworks because Mozilla does most of the GUI
work?
I would not recommend this for a small project, as there are many build
related issues (especially since you'll need to build a separate
Mozilla/XulRunner application for every platform you support) and a
steeper learning curve for getting an application like this to work,
packaged and installable.

Yes, it is definitely a lot easier to build the UI using XUL and it does
look consistently better across multiple platforms.

Using Mozilla you'll gain access to a wealth of components with which
you can take advantage of within your application.

Note also that for the Firefox 3 codebase, it is expected that Python
will become usable in the XUL UI, so instead of writing JavaScript
you'll be able to write Python code that accesses and manipulates the
user interface and the DOM.

Cheers,
Todd
Jul 4 '07 #10
Thorsten Kampe wrote:
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).

Komodo itself is an excellent example of a - at least Python driven -
application that looks superb
I dunno about Windows, but on Linux Komodo/Firefox/etc stick out like
a sore thumb with their ugly, non-native looking widgets (idem. Tk).
wxWidgets will give you native looking apps on both Linux and Windows
(and I think on Macs as well but it's been a while since I looked).

Jul 4 '07 #11
On Jul 4, 2:48 pm, "sjdevn...@yahoo.com" <sjdevn...@yahoo.comwrote:
Thorsten Kampe wrote:
Hi,
I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.
I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).
Komodo itself is an excellent example of a - at least Python driven -
application that looks superb

I dunno about Windows, but on Linux Komodo/Firefox/etc stick out like
a sore thumb with their ugly, non-native looking widgets (idem. Tk).
wxWidgets will give you native looking apps on both Linux and Windows
(and I think on Macs as well but it's been a while since I looked).
They stick out like a grand painting at a kid's art class...

-T

Jul 4 '07 #12
sj*******@yahoo.com wrote:
wxWidgets will give you native looking apps on both Linux and Windows
Well, maybe. There's more to getting a native feel than
just using the right widgets. I once saw a Qt-based app on
MacOSX that had tiny little buttons that were too small
for the text they contained -- Aqua buttons just don't
scale down like that. :-(

--
Greg
Jul 5 '07 #13
On Do, 5.07.2007, 03:45, greg wrote:
sj*******@yahoo.com wrote:
>wxWidgets will give you native looking apps on both Linux and Windows

Well, maybe. There's more to getting a native feel than
just using the right widgets. I once saw a Qt-based app on
MacOSX that had tiny little buttons that were too small
for the text they contained -- Aqua buttons just don't
scale down like that. :-(

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list

Qt based buttons don't either.
If some fool uses absolute positioning and sizing,
then it is not the toolkit to blame.
I'm using wxPython for instance and use the sizers and placeholders
there, so this is possible with Qt also.
So, perhaps (which I don't know) Aqua buttons simply don't permit
absolute stuff ?
Or the Aqua programmers read the user interface guidelines carefully ?
Jul 5 '07 #14
Brett Cannon was doing some work with the Firefox security model to
allow Python coding from within Firefox. He may have stopped doing the
work because it would not lead to a PhD. I am really looking forward to
seeing someone making this a possibility.

Stefan Sonnenberg-Carstens wrote:
On Do, 5.07.2007, 03:45, greg wrote:
>sj*******@yahoo.com wrote:

>>wxWidgets will give you native looking apps on both Linux and Windows
Well, maybe. There's more to getting a native feel than
just using the right widgets. I once saw a Qt-based app on
MacOSX that had tiny little buttons that were too small
for the text they contained -- Aqua buttons just don't
scale down like that. :-(

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Qt based buttons don't either.
If some fool uses absolute positioning and sizing,
then it is not the toolkit to blame.
I'm using wxPython for instance and use the sizers and placeholders
there, so this is possible with Qt also.
So, perhaps (which I don't know) Aqua buttons simply don't permit
absolute stuff ?
Or the Aqua programmers read the user interface guidelines carefully ?
--
Shane Geiger
IT Director
National Council on Economic Education
sg*****@ncee.net | 402-438-8958 | http://www.ncee.net

Leading the Campaign for Economic and Financial Literacy
Jul 5 '07 #15
greg wrote:
sj*******@yahoo.com wrote:
wxWidgets will give you native looking apps on both Linux and Windows

Well, maybe. There's more to getting a native feel than
just using the right widgets. I once saw a Qt-based app on
MacOSX that had tiny little buttons that were too small
for the text they contained -- Aqua buttons just don't
scale down like that. :-(
wxWidgets isn't Qt-related. wx wraps the Aqua widgets on MacOS, the
gtk widgets on Linux, and the Windows widgets on Windows. So you're
actually using the real platform-specific widgets, and if you follow
the style guidelines you'll get pretty native-looking apps (including
things like the menubar showing up in the app on Linux/Windows but
using the main menubar on Mac).

Last I looked (3.1-ish), Qt didn't use the Aqua widgets but rather
tried to write their own widgets that looked (kinda) like the MacOS
widgets. I hear that may have changed in more recent versions, but I
no longer have a Mac. They did do the menubar correctly even at that
time, though.

Jul 5 '07 #16
sj*******@yahoo.com wrote:
Last I looked (3.1-ish), Qt didn't use the Aqua widgets but rather
tried to write their own widgets that looked (kinda) like the MacOS
widgets.
That might be so, but even if it had used real Aqua widgets,
the same problem would have occurred.

My point was that using native widgets is not in itself
enough to ensure a native experience. There are conventions
about *how* the widgets are used, and other things about
the behaviour that don't relate to widgets at all.

Native widgets are certainly a better thing to start
from, though.

--
Greg
Jul 10 '07 #17
Last I looked (3.1-ish), Qt didn't use the Aqua widgets

Qt is now up to 4.3 and they use native Aqua

--
damjan
Jul 10 '07 #18
Thorsten Kampe a écrit :
Hi,

I've already sent this to the Komodo mailing list (which seemed to me
the more appropriate place) but unfortunately I got no response.

I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor
PyQT are actually what I want (because the lack of GUI builders and
they don't really look good on Windows and Linux).
Err... Actually, there are GUI builders for wxWidget (the C++ lib behind
wxPython). And since wxWidgets relies on the platform's GUI libs (native
on Windows, GTK or Metal on unices), I don't get the "don't look good"
point ?

Jul 10 '07 #19
Is that why Komodo is so damned slow????
Brian Quinlan wrote:
Kevin Walzer wrote:
>Komodo is not a Python application. It is a Mozilla application that
supports Python development. Komodo is more akin to Thunderbird and
Firefox than anything else; it uses the XUL framework for rendering
widgets, if I'm not mistaken. If you want to build an application like
Komodo, get a book on developing with the Mozilla framework (XUL, XPCOM,
and all that) and look at that. Python has little to do with that.

Most application logic in Komodo is implemented in Python, using the
PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The
editor is Scintilla (C++).

../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc
...
...
126392 456858 4949602 total

This doesn't include the python code in the Python libraries themselves.

Cheers,
Brian

Jul 13 '08 #20
Brian Quinlan wrote:
>Most application logic in Komodo is implemented in Python, using the
PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The
editor is Scintilla (C++).

../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc
...
...
126392 456858 4949602 total

This doesn't include the python code in the Python libraries themselves.
An interesting breakdown here:
http://www.ohloh.net/projects/10861/analyses/latest

happybrowndog wrote:
Is that why Komodo is so damned slow????
Probably not, no. Pinpointing the reasons for slowness is often a lot
more complicated. Particular slow points in any app/module -- especially
pathologically slow things -- are more often algoritmic than a function
of the language used. Komodo's use of Python is perhaps partially
responsible for a slower startup time than might otherwise be possible
-- but otherwise my experience in Komodo perf work has been algorithmic
issues. Also, if Komodo hadn't been using Python for application logic
since day one we probably wouldn't be much further than Notepad right
now. :)

Cheers,
Trent (komodo developer)

--
Trent Mick
trentm at activestate.com
Jul 14 '08 #21

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gabriele Farina | last post by:
Hi guys, hiow can I create a XUL application that runs with python?? Which libreries I need?? bye
59
by: Hugh Macdonald | last post by:
I've recently been trying out various different GUI frameworks in Python and was wondering if I could get your input on the pros and cons of the different ones... wxPython: I love the...
4
by: Jakub Fast | last post by:
Hi, Does anybody know how far you can get nowadays with trying to use Python as the script language for XUL instead of JS? Is it possible (even theoretically) to write full-fledged applications...
5
by: Sells, Fred | last post by:
I see there are several different choices for Python GUI API's. Is there any indication of which ones are 1. the most commonly used? 2. the most reliable? 3. the most robust?
7
by: Rune Strand | last post by:
What would it take to create a Firefox extension that enables Python as a script language in the browser - just like Javascript? Is it at all possible? Are the hundred good reasons not to bother? ...
2
by: Terry Hancock | last post by:
I recently saw a claim that Mozilla XUL behaviors (normally scripted in Javascript) can (or perhaps will) be scriptable in Python. Also, "other languages such as Java or Python are supported...
4
by: Gilles Ganault | last post by:
Hello I'd like to download pages from a site, but it checks whether the requests are coming from a live user or a script; If the latter, the server returns a blank page. Using a proxy...
4
by: vedrandekovic | last post by:
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build ( or install ) , I get an error: LINK : fatal...
2
by: zelegolas | last post by:
Hi, It's may be a stupid question but do you if someone tried to create a python plugin for firefox? If you know an Open Source project let me know... Thanks
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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,...
1
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...
0
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 ...

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.