473,465 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RAD with Python

Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?

3. Can Python apps be compiled to an exe? Can the resulting executable
be distributed commercially?

4. What types of applications are not suitable to be written in
Python?

I have good knowledge of many languages including C++, Assembler,
Java, etc. My preferred development tool is Clarion currently. If
anybody with a Clarion background can share their experience with
Python, that will be very helpful.

Appreciate your answers...

Thanks & Regards,
Ubaidullah Nubar.
Jul 18 '05 #1
37 10381
P
Ubaidullah Nubar wrote:
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.
Have a look at http://www.netpromi.com/mojoview.html
It uses gtk
2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?
There is a GTK2 port to windows I think.
pyqt is also an option, but you need to pay
to use it on windows.
wxwindows is another popular crossplatform toolkit.
Personally I recommend GTK.
3. Can Python apps be compiled to an exe? Can the resulting executable
be distributed commercially?
yep.
4. What types of applications are not suitable to be written in
Python?
CPU intensive apps, or low level bit manipulation is
better done in C, though you can very easily write parts in C,
or even use psyco for certain python functions.
Note python 2.3 is 25% faster than 2.2.
I have good knowledge of many languages including C++, Assembler,
Java, etc. My preferred development tool is Clarion currently. If
anybody with a Clarion background can share their experience with
Python, that will be very helpful.


Pádraig.

Jul 18 '05 #2
On Fri, Sep 12, 2003 at 06:09:02AM -0700, Ubaidullah Nubar wrote:
Hi,

How well is Python suited for developing database based applications?
U will find python interfaces for almost all mainly used databases.
And as the nature of Python it is very easy to interact with databases
in Python.
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?
If u are new to Python and have no previous experience with C++ then
I think Tkinter is the best place to start. If you are comfortable
with C++ then u can use wxPython. (Actually there is no seperate
documentation for wxPython, it a wrapper around the wxWindows library)

3. Can Python apps be compiled to an exe? Can the resulting executable
be distributed commercially?

Yes, using McMillan and py2exe.
4. What types of applications are not suitable to be written in
Python?

System side softwares
I have good knowledge of many languages including C++, Assembler,
Java, etc. My preferred development tool is Clarion currently. If
anybody with a Clarion background can share their experience with
Python, that will be very helpful.

Appreciate your answers...

Thanks & Regards,
Ubaidullah Nubar.
--
http://mail.python.org/mailman/listinfo/python-list


Regards
Vivek Kumar

Jul 18 '05 #3
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
<ub*************@hotmail.com> wrote:
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?

3. Can Python apps be compiled to an exe? Can the resulting executable
be distributed commercially?

4. What types of applications are not suitable to be written in
Python?

I have good knowledge of many languages including C++, Assembler,
Java, etc. My preferred development tool is Clarion currently. If
anybody with a Clarion background can share their experience with
Python, that will be very helpful.

Appreciate your answers...

Thanks & Regards,
Ubaidullah Nubar.


My choice would be wxPython. Look at the wxPython demo form plenty of
source.

2.
My personal preference of a Python RAD is Boa Constructor.
You will need to install wxWindows (www.wxWindows.org) wxPython
(www.wxPython.org)
and finally the Boa Constructor itself (boa-constructor.sourceforge.net).
The resulting code is portable to unix and maybe mac.

3.
py2exe is used to generate executable python programs under windows.
The resulting code can be freely distrinuted.

4.
Python is appox 400 times slower than C.
If you are doing complex algorithmics on large data sets and a module like
numpy dosn't accelerate what you need you might be better off with another
language.
(Note that for most application the time is spendt in C modules interfaced
by python.)
You have to options:
1. Implement the critical sections in C (the SWIG interface genetrator
helps grind the C interface to pyhton)
2. Use another language (My choice.. I use Common Lisp for complex
algorithmics)
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 18 '05 #4
On Friday 12 September 2003 08:17 am, John wrote:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar

<ub*************@hotmail.com> wrote:
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?


I've used Tkinter for cross platform development with great success
for years, but recently I've been playing with pyGTK (and the
libraries it is built upon: GTK+, glade-2 and libglade), and
I like the results very much.

PyGTK works on both window and Linux/Unix, Comparing the two, it seems
that PyGTK produces GUI's which look much better, and are *much* more
responsive. And the GUI building tool, glade-2, is *very* easy and
convenient to work with.
New version have just come out in the last several days, so look for
and install the latest.

Gary Herron


Jul 18 '05 #5

"Ubaidullah Nubar" <ub*************@hotmail.com> wrote in message
news:17**************************@posting.google.c om...
Hi,

How well is Python suited for developing database based applications? I am new to Python so please bear with me if some of the questions are too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app with a listbox displaying all addresses with the ability to
add/modify/delete.
I hope someone else answers this.
2. There seem to be a number of GUI frameworks available? Which one is good for use on Windows and Linux?
Most people prefer the one they use. No surprise. Use google to find
previous threads on this topic.
3. Can Python apps be compiled to an exe?
No, Python code cannot currently be compiled to a native code .exe in
the way you probably mean. Yes, Python bytecode (including included
modules) can be combined with a copy of the interpreter in a
distributable .exe, Googling 'Python executable' perhaps with
'McMillan' (spelling?) should get you previous posts with links.
Can the resulting executable be distributed commercially?
Yes.
4. What types of applications are not suitable to be written in

Python?

Hmmm.

Terry J. Reedy
Jul 18 '05 #6
John <jo************@chello.no> writes:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
<ub*************@hotmail.com> wrote: [...] 4.
Python is appox 400 times slower than C.

[...]

Maybe this was intended to be a silly number, but: this means very
little. The degree of slowdown is hugely variable from one domain to
the next, and from one program to the next, and I've never heard
anyone else quote an indicative figure anywhere near that high.
John
Jul 18 '05 #7
On Friday 12 September 2003 10:35 am, John J. Lee wrote:
John <jo************@chello.no> writes:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
<ub*************@hotmail.com> wrote:


[...]
4.
Python is appox 400 times slower than C.


[...]

Maybe this was intended to be a silly number, but: this means very
little. The degree of slowdown is hugely variable from one domain to
the next, and from one program to the next, and I've never heard
anyone else quote an indicative figure anywhere near that high.


Right. The figure most often stated seems to be about 50, but as you
say, there is so much variation that any number is nearly useless.

Gary Herron

Jul 18 '05 #8
vi***@cs.unipune.ernet.in schreef:
(Actually there is no seperate documentation for wxPython, it a wrapper
around the wxWindows library)


There is a bit of wxPython documentation here:
<http://www.orbtech.com/www/wxPythonDocs.html>

Looks like the start of a work-in-progress to me, and I think it comes with
the last wxPython release too.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #9
On 2003-09-12, vi***@cs.unipune.ernet.in <vi***@cs.unipune.ernet.in> wrote:
If u are new to Python and have no previous experience with C++ then
I think Tkinter is the best place to start. If you are comfortable
with C++ then u can use wxPython. (Actually there is no seperate
documentation for wxPython, it a wrapper around the wxWindows library)


Actually I had no prior experience with C++ (or C) and found
wxPython extremely easy to use. I don't see how C++ is needed to read
the docs for wxWindows. You just ignore the datatypes and read the
notes on where the wxPython version differs from wxWindows. For example
wxTextCntl.PositionToXY(). In wxWindows it takes 3 arguments, the
position and two variables to return the x and y positions into.
Underneath it it clearly says the wxPython method returns a tuple
(x, y).

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #10
"Ubaidullah Nubar" <ub*************@hotmail.com> wrote in message
news:17**************************@posting.google.c om...
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

.....


In addition to the other recommendations made, you might want to check
out PythonCard [http://pythoncard.sourceforge.net/]. It is based on
wxPython (like Boa Constructor preciously mentioned), which provides a
cross-platform GUI capability. There are a lot of samples a few of
which come close to what you've described (check dbBrowser &
dbBrowser2). There is another project: GNUe
[http://www.gnuenterprise.org/project/what.php], which plans to be a
full-blown ERP system at some point, but is creating database designer,
forms, reporting, etc. tools to support the overall package. These are
in some way like what you may be considering, but I don't think that
it's quite ready yet.

As far as something that is like Clarion - I don't think you'll find
anything that can easily duplicate what you can do with that tool. That
IS something that I would also really like to see, whether you're coming
from Clarion, MS Access, FileMaker, FoxPro, Alpha Software, or any of
those type of RAD, database type tools. While each of them have their
strengths and differences, they all are in the same general solution
space, and it seems that a Python based tool could work very well in
that space. It seems that the MojoView package may be the closest.
I've been thinking about what it would take to write this myself, but,
for the time being, the project is a bit more work than I can take on
right now. Good luck if you start pursuing it.
--
Greg

Jul 18 '05 #11
In article <17**************************@posting.google.com >, Ubaidullah
Nubar wrote:
1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.
You might want to take a look at

http://www.netpromi.com/mojoview.html

and

http://www.async.com.br/projects/kiwi/ (which can interface with ZODB)

There used to be an interesting project called Koala, but it seems to have
died.

http://koala.sourceforge.net/
2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?


wxPython or good old Tkinter are probably the best bets currently, or PyQt
if the licensing is not an issue for you.

Dave Cook
Jul 18 '05 #12
Thanks to all those who replied.

I will appreciate some more clarification regarding the GUI framework.
From the wxPython web site, it looks very good but the two tools
mentioned here
for easing the development of GUI apps (mojoview and kiwi) are both
based on GTK.

Are they fundamentally different or just a matter of style.

How easy to switch from one framework to another?

Which framework supports internationalization better? Do they support
Right-to-left layouts?

Is there any site that lists the differences/capabilities of each
framework?

Also, a comparison between Boa Constructor and Glade-2. I haven't seen
either so am not sure if they are even comparable.

Thanks & Regards,
Ubaidullah Nubar.
John <jo************@chello.no> wrote in message news:<op**************@news.chello.no>...
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
<ub*************@hotmail.com> wrote:
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?

3. Can Python apps be compiled to an exe? Can the resulting executable
be distributed commercially?

4. What types of applications are not suitable to be written in
Python?

I have good knowledge of many languages including C++, Assembler,
Java, etc. My preferred development tool is Clarion currently. If
anybody with a Clarion background can share their experience with
Python, that will be very helpful.

Appreciate your answers...

Thanks & Regards,
Ubaidullah Nubar.


My choice would be wxPython. Look at the wxPython demo form plenty of
source.

2.
My personal preference of a Python RAD is Boa Constructor.
You will need to install wxWindows (www.wxWindows.org) wxPython
(www.wxPython.org)
and finally the Boa Constructor itself (boa-constructor.sourceforge.net).
The resulting code is portable to unix and maybe mac.

3.
py2exe is used to generate executable python programs under windows.
The resulting code can be freely distrinuted.

4.
Python is appox 400 times slower than C.
If you are doing complex algorithmics on large data sets and a module like
numpy dosn't accelerate what you need you might be better off with another
language.
(Note that for most application the time is spendt in C modules interfaced
by python.)
You have to options:
1. Implement the critical sections in C (the SWIG interface genetrator
helps grind the C interface to pyhton)
2. Use another language (My choice.. I use Common Lisp for complex
algorithmics)

Jul 18 '05 #13
Gary Herron <gh*****@islandtraining.com> wrote in message news:<ma**********************************@python. org>...
On Friday 12 September 2003 08:17 am, John wrote:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar

<ub*************@hotmail.com> wrote:
Hi,

How well is Python suited for developing database based applications?
I am new to Python so please bear with me if some of the questions are
too simple. I specifically have the following questions:

1. Is there an example of a simple data-entry application written in
Python using a GUI interface? Something like a simple address book app
with a listbox displaying all addresses with the ability to
add/modify/delete.

2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?


I've used Tkinter for cross platform development with great success
for years, but recently I've been playing with pyGTK (and the
libraries it is built upon: GTK+, glade-2 and libglade), and
I like the results very much.

PyGTK works on both window and Linux/Unix, Comparing the two, it seems
that PyGTK produces GUI's which look much better, and are *much* more
responsive. And the GUI building tool, glade-2, is *very* easy and
convenient to work with.


Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?

Reading some other threads on this ng, there are posts that mention
that gtk has issues running under Win32. Are these concerns still
valid or have they been resolved with the latest version?
Jul 18 '05 #14
ub*************@hotmail.com (Ubaidullah Nubar) writes:
Gary Herron <gh*****@islandtraining.com> wrote in message news:<ma**********************************@python. org>...
[...comparing Tk and GTk...]
PyGTK works on both window and Linux/Unix, Comparing the two, it seems
that PyGTK produces GUI's which look much better, and are *much* more
responsive. And the GUI building tool, glade-2, is *very* easy and
convenient to work with.


Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?


They all look good except Tkinter <0.5 wink>. Tkinter builds up some
of its widgets (eg. tree views, IIRC) from simpler native widgets, so
they don't look on Windows as nice as native tree views. At least,
that used to be the case.

In fact that's unfair on Tkinter, since AFAIK no toolkit works well
with both KDE and GNOME. Yes, they both (usually) use X windows, X
never *had* a 'look and feel' in the first place. KDE and GNOME each
define a lot about the way things look and the way things work, so KDE
apps look bad in GNOME, and vice versa. The consensus is that nobody
can be bothered to put in the work to fix this.

I don't know why GTk sometimes looks bad on Windows. Of course, in
one sense the reason is simply that it didn't start out there, but I
don't know what the particulars are.

Reading some other threads on this ng, there are posts that mention
that gtk has issues running under Win32. Are these concerns still
valid or have they been resolved with the latest version?


You can certainly get good-looking Windows GUIs out of GTk
(eg. http://www.workrave.org/), but people complain that it's hard to
do (in fact, people frequently complain that GTk is in general
difficult to work with when compared with the other popular toolkits
-- partly due to the lack of documentation).

I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.
John
Jul 18 '05 #15
In article <87************@pobox.com>, John J. Lee wrote:
You can certainly get good-looking Windows GUIs out of GTk
(eg. http://www.workrave.org/), but people complain that it's hard to
do (in fact, people frequently complain that GTk is in general
difficult to work with when compared with the other popular toolkits
-- partly due to the lack of documentation).
Aside from win32 issues, (which don't really worry me all that much at the
end of the day, YMMV) I'd say the *only* major problem with Gtk is
incomplete documentation. Otherwise it is an excellent, rationally designed
toolkit. It's reasonably lightweight, very responsive, has an excellent set
of controls, and is easy to bind to other languages. It's my preferred
toolkit. However, it is a UI TOOLKIT, not an app framework, and if you're
expecting an app framework you are likely to be disappointed.

There are app frameworks built on top of gtk like kiwi (still using gtk1,
but they're working on a gtk2 port.)

http://www.async.com.br/projects/kiwi/
I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.


Change GNOME to unix and I'd agree. One can write very good Gtk apps
without ever touching the GNOME libraries.

Dave Cook
Jul 18 '05 #16
In article <17**************************@posting.google.com >, Ubaidullah
Nubar wrote:
Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?
Gtk does not use the native win32 controls. There's a theme that apparently
does use the native controls, but I've heard that it's slow. So it's not
the toolkit to choose right now if native look and feel is an overriding
concern.
Reading some other threads on this ng, there are posts that mention
that gtk has issues running under Win32. Are these concerns still
valid or have they been resolved with the latest version?


The latest version fixes some bugs, but the win32 port is still not very
mature, and does not have as large a community of testers as the unix
version.

Dave Cook
Jul 18 '05 #17
ub*************@hotmail.com (Ubaidullah Nubar) schreef:
Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?


On X (*nix/Linux) there isn't something like "the underlying GUI", and
there are several concurrent GUI toolkits (Tk, GTK/Gnome & Qt/KDE are
probably the best known). There exist Tk, GTK & Qt ports to Windows, but
they indeed (re)create all or most GUI elements (just like they do on X).

wxWindows is a cross-platform layer that can use a native GUI (and does so
by default). So, on Win32 it uses & looks like the Win32 GUI, on Linux it
uses GTK, on MacOS X it uses the standard Mac interface, etc.
(Recent versions of) GTK and Qt can emulate (or even use?) the Windows GUI,
but I'm told this is slow compared to using the native GUI or wxWindows.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #18
Ubaidullah Nubar wrote:

Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?
I'm pretty sure GTK draws it's own widgets and does not use the
underlying Windows API.
Reading some other threads on this ng, there are posts that mention
that gtk has issues running under Win32. Are these concerns still
valid or have they been resolved with the latest version?


Although none of my pygtk apps have been super-complex, I have had
little to no problems running them under Windows. They perform well.
Getting them to look good is usually a matter of choosing a good looking
theme engine (I use the bluecurve engine under windows) and tweaking
your Gtk rc file (for example, picking Tahoma 8pt as the font).

Jul 18 '05 #19
On 2003-09-13, John J. Lee <jj*@pobox.com> wrote:
I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.


I run several GTK apps that don't touch Gnome:
Sylpheed-Claws
Pan
XChat

GTK != GNOME.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #20
On 2003-09-14, David M. Cook <da******@nowhere.net> wrote:
Gtk does not use the native win32 controls. There's a theme that apparently
does use the native controls, but I've heard that it's slow. So it's not
the toolkit to choose right now if native look and feel is an overriding
concern.


However wxWindows (and by extension wxPython) does use Windows
native on Windows and GTK Unix.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #21
"David M. Cook" <da******@nowhere.net> writes:
In article <87************@pobox.com>, John J. Lee wrote:
You can certainly get good-looking Windows GUIs out of GTk
(eg. http://www.workrave.org/), but people complain that it's hard to
do (in fact, people frequently complain that GTk is in general
difficult to work with when compared with the other popular toolkits
-- partly due to the lack of documentation).
Aside from win32 issues, (which don't really worry me all that much at the
end of the day, YMMV) I'd say the *only* major problem with Gtk is
incomplete documentation. Otherwise it is an excellent, rationally designed
toolkit. It's reasonably lightweight, very responsive, has an excellent set
of controls, and is easy to bind to other languages. It's my preferred
toolkit. However, it is a UI TOOLKIT, not an app framework, and if you're
expecting an app framework you are likely to be disappointed.


Not sure what design features you're referring to by "framework".
Perhaps Qt's signal/slot system? I think that works particularly well
as an integrated part of the GUI system, although it's certainly
possible to graft something very similar on top of GTk (as Bernhard
Herzog did in sketch; kiwi looks broader and heavier, at a glance).
None of that seems inappropriate in a GUI toolkit (not referring to
kiwi here, just Herzog's publisher/subscriber stuff). What does seem
like bloat to a Python user are Qt's XML, SQL and threading libraries
-- at least you don't have to import them or know about them.

There are app frameworks built on top of gtk like kiwi (still using gtk1,
but they're working on a gtk2 port.)

http://www.async.com.br/projects/kiwi/
I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.


Change GNOME to unix and I'd agree. One can write very good Gtk apps
without ever touching the GNOME libraries.


It's not whether it can be done, it's how painful it is. There seems
to be a constant procession of people who have trouble using GTk, but
not for wx. I certainly had trouble with GTk, just due to lack of
docs. If you already know GTk, I guess, that's not a problem. And
maybe I'll discover more reasons for using GTk when I try wx...
John
Jul 18 '05 #22
"David M. Cook" <da******@nowhere.net> writes:
In article <17**************************@posting.google.com >, Ubaidullah
Nubar wrote:
Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?


Gtk does not use the native win32 controls. There's a theme that apparently


I guess this is because X toolkits work at a lower level than the
win32 windowing API?

Having looked at some of the Xfree code and documentation, I'm glad
that I know next to nothing about X.
John
Jul 18 '05 #23
JanC <us*********@janc.invalid> writes:
ub*************@hotmail.com (Ubaidullah Nubar) schreef:
Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
Windows API/KDE/Gnome, etc.)? So where does the better looking part
come from? Or do some of them recreate the whole GUI layer?
On X (*nix/Linux) there isn't something like "the underlying GUI", and
there are several concurrent GUI toolkits (Tk, GTK/Gnome & Qt/KDE are
probably the best known). There exist Tk, GTK & Qt ports to Windows, but
they indeed (re)create all or most GUI elements (just like they do on X).

wxWindows is a cross-platform layer that can use a native GUI (and does so
by default). So, on Win32 it uses & looks like the Win32 GUI, on Linux it
uses GTK, on MacOS X it uses the standard Mac interface, etc.


Well, I suppose I really don't know whether or not Qt uses, say, the
native Windows tree control. In the end, that's the point of
interest: both Qt and wx were designed from the ground up to be
cross-platform (unlike Tk -- I presume -- and certainly unlike GTk).
Without reading the source code, you'd be hard pushed to figure out
which things Qt reimplements, and which it reuses.

(Recent versions of) GTK and Qt can emulate (or even use?) the Windows GUI,
but I'm told this is slow compared to using the native GUI or wxWindows.


Qt has never been slow or looked bad on Windows (or unix).
John
Jul 18 '05 #24
John J. Lee wrote:

I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.

I've just been putting myself through a sort of a crash course in pygtk,
basically a text indexing and retrieval application which already existed
in several Windows and KDE versions as well as a Tcl/Tk version which
nobody had used in several years. The idea is to have some sort of a
version of the thing which integraters could work with, i.e. written mainly
in a scripting language, and python appears to be several levels of
advancement above Tcl.

Tk appears to be more functional at this point, nonetheless there was no way
to avoid having Tk code twisted and wound in and around app code in the Tcl
version of the thing whereas the glade/gtk version of the thing produces a
gui in an XML file and an absolute minimum of anything related to guis in
my own code. The difference between the two is about 400 lines of very
readable code versus about 2500 lines of code which was marginally
readable. I'd MUCH rather deal with pygtk, and assume anything I might
miss from Tk will be there in a year.

The LINUX community appears to have developed a sort of a magical nexus of
things including gcc, swig, python, pygtk, glade, and zope which, taken
together, amounts to a new sort of programming paradigm. The really big
piece of magic in the picture is swig. This says that you you can write
library code in c++ and call it from a python program with a gui produced
by glade sitting there in an XML file, and all you'd ever need to
distribute to customers would be the .so file which swig produced, one or
two .py files, and the xml file. That also says that if a customer wasn't
totally happy with some aspect of the interface, he could screw around with
it until he was.

I don't see an easy way to beat all of that.
Jul 18 '05 #25
Steve Lamb <gr**@despair.dmiyu.org> writes:
On 2003-09-13, John J. Lee <jj*@pobox.com> wrote:
I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.


I run several GTK apps that don't touch Gnome:
Sylpheed-Claws
Pan
XChat

GTK != GNOME.

[...]

Yep: that's exactly what I don't understand! *Why* did you do that?
John
Jul 18 '05 #26
Ted Holden <me****@fcc.net> writes:
John J. Lee wrote:

I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.
[...] in a scripting language, and python appears to be several levels of
advancement above Tcl.
Tcl, maybe, but what about wx and Qt?

Tk appears to be more functional at this point, nonetheless there was no way
to avoid having Tk code twisted and wound in and around app code in the Tcl
version of the thing whereas the glade/gtk version of the thing produces a
(A side issue given the point below, but I certainly dispute that.
Even if you don't have a "GUI painter", you can separate GUI interface
from "business logic" implementation).

gui in an XML file and an absolute minimum of anything related to guis in
my own code. The difference between the two is about 400 lines of very
readable code versus about 2500 lines of code which was marginally
readable. I'd MUCH rather deal with pygtk, and assume anything I might
miss from Tk will be there in a year.
Certainly a big reduction in code size like this is very worthwhile.
wx and Qt both have equivalent functionality, though, so the mere
existence of such a tool seems an irrelevance in comparing GTk, wx and
Qt.

The LINUX community appears to have developed a sort of a magical nexus of
things including gcc, swig, python, pygtk, glade, and zope which, taken
together, amounts to a new sort of programming paradigm. The really big
What does this have to do with the comparison between GTk, wx and Qt,
all of which are all GPLed?
[...] I don't see an easy way to beat all of that.


Sorry for my repetitiveness, but: wx or Qt!
John
Jul 18 '05 #27
jj*@pobox.com (John J. Lee) writes:
Steve Lamb <gr**@despair.dmiyu.org> writes:
On 2003-09-13, John J. Lee <jj*@pobox.com> wrote:
I've never seen anybody give a convincing reason why GTk is a good
choice for *anything* except writing GNOME apps.


I run several GTK apps that don't touch Gnome:
Sylpheed-Claws
Pan
XChat

GTK != GNOME.

[...]

Yep: that's exactly what I don't understand! *Why* did you do that?
John


Don't know about others, but I do it (run gtk-not-gnome apps) because
GTK...

a) Is easy to install on a variety of commercial *NIX systems, and
getting better on MS Win** (contrast to gnome).

b) Is fast loading (contrast to wx).

c) Is GPL on all platforms (contrast to QT/KDE).

d) Is rich enough/attractive enough (contrast to tcl).

e) Is less painful to bring up than a gnome or kde app if you happen
to be starting from somewhere else (e.g., fvwm2).

So while I run pretty much everything on my trusty Linux boxes, I tend
to focus on gtk for multi-platform.
--
ha************@boeing.com
6-6M31 Knowledge Management
Phone: (425) 342-5601
Jul 18 '05 #28
On 2003-09-15, John J. Lee <jj*@pobox.com> wrote:
Steve Lamb <gr**@despair.dmiyu.org> writes:
I run several GTK apps that don't touch Gnome:
Sylpheed-Claws
Pan
XChat GTK != GNOME. [...]

Yep: that's exactly what I don't understand! *Why* did you do that?


What, run GTK apps that don't touch Gnome? Simple reason: Gnome
sucks. I run KDE. I wouldn't want to load the full gamut of gnome libs
but the GTK libs are ok.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #29
ub*************@hotmail.com (Ubaidullah Nubar) wrote in message news:<17**************************@posting.google. com>...
I will appreciate some more clarification regarding the GUI framework.
From the wxPython web site, it looks very good but the two tools
mentioned here
for easing the development of GUI apps (mojoview and kiwi) are both
based on GTK.

Are they fundamentally different or just a matter of style.
Well, pyGTK and wxPython are Python-language wrappers or bindings
around two separate GUI toolkits, GTK+ and wxWindows. As such, the
code details will wind up being different. I suspect, though I have
no experience with pyGTK, that differences will be mostly syntactic
and that overall coding thought processes will be mostly similar. Can
anyone else confirm/deny?
How easy to switch from one framework to another?

See above answer.
Which framework supports internationalization better? Do they support
Right-to-left layouts?
I know that wxPython relies on wxWindow's internationalization
capabilities, which seem to be centered around gettext and friends. I
do not see anything in the documentation that suggests support for
bidirectional font support. Seeing as how gettext and GTK+ are both
GNU apps, it should come as no surprise that GTK+ also uses gettext.
Is there any site that lists the differences/capabilities of each
framework?
There is a comparison of wxWindows, Qt, GTK+, FOX and fltk at:
http://freshmeat.net/articles/view/928/
which provides an overview of the differences between the various
toolkits. I know there is a comparison on the wxPython site between
itself and Tk, though you can guess the conclusion from the source. I
don't know of any comparisons between the Python bindings for the
above toolkits.
Also, a comparison between Boa Constructor and Glade-2. I haven't seen
either so am not sure if they are even comparable.


Boa-Constructor is a fully-fledged IDE that includes a code editor,
debugging, and a GUI designer tool. Boa is based around wxPython, and
also includes substantial support for development for the Zope
application server. Boa-Constructor is not yet fully mature, but
shows much promise.

Glade is a GUI designer only, that generates XML resource files used
by GTK+ to generate the GUI interface. As such, it is not directly
comparable with Boa. PyGTK has support for working with such resource
files.

Interestingly enough, wxGlade is a more-or-less copy of Glade, but for
use with wxPython rather than GTK+, and it generates "cleaner" code
than Boa-Constructor.
How well is Python suited for developing database based applications?
Very well suited. Python has a standard database interface module
available which makes it easy to connect to just about any database.
Typically there are multiple drivers available for any given database
from which to choose. Python itself is extremely easy to write, and
Python wrappers for many different GUI toolkits are available.
2. There seem to be a number of GUI frameworks available? Which one is
good for use on Windows and Linux?
I've found that wxPython works well cross-platform, and is easy to
use. I've heard good things about pyGTK and pyQT, but have no
experience with them.
4. What types of applications are not suitable to be written in
Python?


CPU-intensive applications -- maybe. Python is not as efficient as C,
so you would be better off writing the application in Python,
profiling it to determine the areas that make the application slower
than is acceptable, and rewriting those modules as C libraries and
calling them from Python. For what it is worth, I'm currently writing
an application in Python using wxPython that retrieves simple data
from a Sybase Adaptive Server Anywhere database over ODBC, and formats
the data into a report page in generated HTML. By many orders of
magnitude, the slowest part of the application is the connection to
the database -- the ODBC connection itself. The Python and wxPython
parts are whiz-bang fast.
Jul 18 '05 #30
Steve Lamb <gr**@despair.dmiyu.org> writes:
On 2003-09-15, John J. Lee <jj*@pobox.com> wrote:
Steve Lamb <gr**@despair.dmiyu.org> writes:
I run several GTK apps that don't touch Gnome:
Sylpheed-Claws
Pan
XChat GTK != GNOME.

[...]

Yep: that's exactly what I don't understand! *Why* did you do that?


What, run GTK apps that don't touch Gnome? Simple reason: Gnome
sucks. I run KDE. I wouldn't want to load the full gamut of gnome libs
but the GTK libs are ok.


Sorry, misread that as saying you *wrote*, not *run*.
John
Jul 18 '05 #31
jj*@pobox.com (John J. Lee) schreef:
Well, I suppose I really don't know whether or not Qt uses, say, the
native Windows tree control. In the end, that's the point of
interest: both Qt and wx were designed from the ground up to be
cross-platform (unlike Tk -- I presume -- and certainly unlike GTk).
Without reading the source code, you'd be hard pushed to figure out
which things Qt reimplements, and which it reuses. Qt has never been slow or looked bad on Windows (or unix).


According to their website they use native Windows API, but when I tried
some Qt-programs I've seen those subtle differences with normal Windows-
applications, which is very annoying at times. When something looks
similar, you expect it to behave similar. :-(
(A good example of this is dialog boxes with No/Yes while that should be
Yes/No on Windows.)

The rather simple Qt applications I have tried (one of them was Psi) took
about 25-35% of system & GDI resource handles on Win98 (resource handles
going below 5-10% is almost always "good" for a system crash in Win9x...)
and they reacted a little slow at times. Until now I never got this
problem with wxWindows programs (e.g. Audacity) on Win98.

All this gave me the "I don't like Qt" feeling, but maybe it's just that I
tried the wrong applications. ;-)

Thinking about it, this might just be a Win9x <-> WinNT issue.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #32
> > I will appreciate some more clarification regarding the GUI framework.
From the wxPython web site, it looks very good but the two tools
mentioned here
for easing the development of GUI apps (mojoview and kiwi) are both
based on GTK.

Are they fundamentally different or just a matter of style.


Well, pyGTK and wxPython are Python-language wrappers or bindings
around two separate GUI toolkits, GTK+ and wxWindows. As such, the
code details will wind up being different. I suspect, though I have
no experience with pyGTK, that differences will be mostly syntactic
and that overall coding thought processes will be mostly similar. Can
anyone else confirm/deny?


If they both have a similar style, then that would be good as it will
be easy to convert from one to the other easily. Otherwise, one would
have to be extra-cautious before selecting the framework for large
projects.

Which framework supports internationalization better? Do they support
Right-to-left layouts?


I know that wxPython relies on wxWindow's internationalization
capabilities, which seem to be centered around gettext and friends. I
do not see anything in the documentation that suggests support for
bidirectional font support. Seeing as how gettext and GTK+ are both
GNU apps, it should come as no surprise that GTK+ also uses gettext.


The article that you mentioned below states that GTK+ has bidrectional
support. Doesn't mention anything similar for wxPython. But there are
references in wxWindows docs about right-to-left. Anybody knows how it
compares to GTK+?

Is there any site that lists the differences/capabilities of each
framework?


There is a comparison of wxWindows, Qt, GTK+, FOX and fltk at:
http://freshmeat.net/articles/view/928/


Thanks for the link. It is quite informative.
Also, a comparison between Boa Constructor and Glade-2. I haven't seen
either so am not sure if they are even comparable.


Boa-Constructor is a fully-fledged IDE that includes a code editor,
debugging, and a GUI designer tool. Boa is based around wxPython, and
also includes substantial support for development for the Zope
application server. Boa-Constructor is not yet fully mature, but
shows much promise.

Glade is a GUI designer only, that generates XML resource files used
by GTK+ to generate the GUI interface. As such, it is not directly
comparable with Boa. PyGTK has support for working with such resource
files.

Interestingly enough, wxGlade is a more-or-less copy of Glade, but for
use with wxPython rather than GTK+, and it generates "cleaner" code
than Boa-Constructor.


I have been working through some wxPython examples. When external
resources like icons or images are used on a control, is there a way
to embed it into the freezed executable?

Thanks & Regards,
Ubaidullah Nubar.
Jul 18 '05 #33
JanC <us*********@janc.invalid> wrote in message news:<Xn******************@213.118.75.228>...
According to their website they use native Windows API, but when I tried
some Qt-programs I've seen those subtle differences with normal Windows-
applications, which is very annoying at times. When something looks


Thats what they say: native Windows API, not native Widgets.

Maybe you should finetune your text reading precision level.
Jul 18 '05 #34
vi***@cs.unipune.ernet.in wrote in message news:<ma**********************************@python. org>...
On Fri, Sep 12, 2003 at 06:09:02AM -0700, Ubaidullah Nubar wrote:

(snip)
4. What types of applications are not suitable to be written in
Python?


System side softwares


I don't know what "system side softwares" means...

The one real drawback that comes up a lot when discussing python is
speed, since it's quite a lot slower than C.

Usually that's actually not a problem. When speed matters, good
results can be had by A) profiling and fixing your algorithms, B)
using psyco, C) replacing slow pure-python stuff with third-party C
extensions, D) replacing any remaining slow pure-python slow stuff
with your own C extensions.

However, there is at least one case when that's not likely to be
enough. An application that has critical realtime deadlines should
probably not have the python interpreter running in the realtime part.
Example, realtime DSP. Say you're processing audio in a live
performance setting. If the interpreter decides to do a bunch of
garbage collection or otherwise slows down for a moment, you could
easily miss a deadline and get very nasty dropouts in the output.

Even in this case, python can be a useful part of the application as
long as the interpreter is kept away from the time-sensitive parts of
the app.
Here's a REALLY cool project with a C DSP engine controlled by the
movement of physical objects whose movements are detected and refleted
by a Python / OpenGL UI:
http://web.media.mit.edu/~jpatten/newaudiopad.html
Jul 18 '05 #35
ll*****@web.de (Lothar Scholz) schreef:
JanC <us*********@janc.invalid> wrote in message news:<Xn******************@213.118.75.228>...
According to their website they use native Windows API, but when I tried
some Qt-programs I've seen those subtle differences with normal Windows-
applications, which is very annoying at times. When something looks


Thats what they say: native Windows API, not native Widgets.

Maybe you should finetune your text reading precision level.


If you read both of my messages you can see that I doubted they were using
the Windows GUI (which is part of the Windows APIs), even if I didn't say
that explicitly (that happens at 4:11am ;)

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #36
ub*************@hotmail.com (Ubaidullah Nubar) schreef:
I have been working through some wxPython examples. When external
resources like icons or images are used on a control, is there a way
to embed it into the freezed executable?


Look at img2py.py in the wxPython/tools directory.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
Jul 18 '05 #37
ub*************@hotmail.com (Ubaidullah Nubar) wrote in message news:<17**************************@posting.google. com>...
I will appreciate some more clarification regarding the GUI framework.
From the wxPython web site, it looks very good but the two tools
mentioned here
for easing the development of GUI apps (mojoview and kiwi) are both
based on GTK.
Well, I can speak of Kiwi at least, which I designed to help us write
large GUI applications in Python, here at Async Open Source.

Kiwi is different from most of the other frameworks you'll find in the
sense that it encourages you to move beyond the string manipulation
that's so common in GUI programming (read a string from an entry,
write a string to a label, etc etc). In Kiwi, you're expected to work
with objects holding data and low-level domain semantics (want to
display objects as a list? define the columns, and load the objects in
the list with one call; no more worrying about string/numeric/date
conversions).

Kiwi *really* cuts code length down; you could probably write a
phonebook application like you've asked initially in less than 40
lines, if using libglade.

The intention when writing Kiwi was to allow you to be truly object
oriented while coding; it's not a simple wrapper around a C/C++ API as
most of the other GUI libraries are (of course, Kiwi hijacks James'
PyGtK library to its own evil purpose)
Are they fundamentally different or just a matter of style.

How easy to switch from one framework to another?
Kiwi is fundamentally different, though you can use as much as you
like (just the base view classes, the proxy, the widgets, etc).

I think you'll find that the more you use a framework, the harder it
is to switch (as with any library).
Which framework supports internationalization better? Do they support
Right-to-left layouts?
GTK+2 has this pretty much solved; pango is a very nice
implementation.
Also, a comparison between Boa Constructor and Glade-2. I haven't seen
either so am not sure if they are even comparable.


Glade, when associated with libglade, is a *great* way to write the
GUI. All Glade does is generate XML, which libglade reads at runtime
-- the rest is real code, version-controllable code that you can work
with in your preferred editor.

There's nothing that offers comparable reuse and long-term
productivity, IMHO, but others will differ.
Jul 18 '05 #38

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

Similar topics

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
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,...
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
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.