473,769 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ 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
37 10444
On 2003-09-14, David M. Cook <da******@nowhe re.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******@nowhe re.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******@nowhe re.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*********@ja nc.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.d miyu.org> writes:
On 2003-09-13, John J. Lee <jj*@pobox.co m> 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.d miyu.org> writes:
On 2003-09-13, John J. Lee <jj*@pobox.co m> 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.co m> wrote:
Steve Lamb <gr**@despair.d miyu.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.go ogle.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 internationaliz ation better? Do they support
Right-to-left layouts?
I know that wxPython relies on wxWindow's internationaliz ation
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

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

Similar topics

0
9579
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9987
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
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

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.