RAD with Python

U

Ubaidullah Nubar

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.
 
V

vivek

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.

Regards
Vivek Kumar
 
P

P

Ubaidullah said:
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.
 
J

John

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)
 
G

Gary Herron

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
 
T

Terry Reedy

Ubaidullah Nubar said:
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
 
J

John J. Lee

John said:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
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
 
G

Gary Herron

John said:
On 12 Sep 2003 06:09:02 -0700, Ubaidullah Nubar
[...]

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
 
S

Steve Lamb

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).
 
G

Greg Brunet

Ubaidullah Nubar said:
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.
 
D

David M. Cook

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
 
U

Ubaidullah Nubar

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.
 
U

Ubaidullah Nubar

Gary Herron said:
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?
 
J

John J. Lee

Gary Herron <[email protected]> wrote in message

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
 
D

David M. Cook

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
 
D

David M. Cook

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
 
J

JanC

(e-mail address removed) (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.
 
J

Jamey Cribbs

Ubaidullah said:
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).
 
S

Steve Lamb

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,167
Messages
2,570,911
Members
47,453
Latest member
MadelinePh

Latest Threads

Top