Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python GUI app to impress the boss?

3 views
Skip to first unread message

Lee Gray

unread,
Sep 17, 2002, 5:05:54 PM9/17/02
to
I'm a fairly new programmer with experience in ASP/VBScript/DHTML.
Other than small utilities, so far I've mostly written ASP apps to
talk to an Oracle database on HP/UX, with Windows NT/2000 clients, and
I've done maintenance work on VB and Oracle Forms apps.

We're currently looking at .Net, and I'm not very impressed, for a
variety of reasons. A little research makes me feel that either Java
or Python would be a good alternative, and given my level of
experience, I'd much prefer Python over Java. I *think* I could
actually get up to speed faster with Python than with VB and ASP.Net,
in spite of my ASP/VBS experience.

My boss is pretty open-minded, but also needs to see something working
to be convinced Python is even a viable platform (he had never heard
of it). Otherwise, .Net is a given, whether it's any good or not,
since corporate is MS all the way.

Can someone point me to a good Python GUI app to demonstrate (other
than IDLE)?

It may very well be that .Net is best for me/us, but from what I've
seen of Python, I *really* like the language and I'd at least like to
see a good demonstration of a full-blown app before ruling it out.
(Something along the lines of what I mentioned above would be ideal,
but not a necessity.)

Thanks!

Lee Gray

Jay O'Connor

unread,
Sep 17, 2002, 4:17:09 AM9/17/02
to
In article <96904b50.02091...@posting.google.com>, "Lee Gray"
<lpg...@uop.com> wrote:

>
> Can someone point me to a good Python GUI app to demonstrate (other than
> IDLE)?

Bioreason makes some products in Python. You can see some screenshots of
their Python/Gtk products here: http://www.bioreason.com/lead.html and
http://www.bioreason.com/drug.html

--
Jay O'Connor
joco...@cybermesa.com
http://www.r4h.org/r4hsoftware

Chris Liechti

unread,
Sep 17, 2002, 5:20:11 PM9/17/02
to
lpg...@uop.com (Lee Gray) wrote in
news:96904b50.02091...@posting.google.com:

> My boss is pretty open-minded, but also needs to see something working
> to be convinced Python is even a viable platform (he had never heard
> of it). Otherwise, .Net is a given, whether it's any good or not,
> since corporate is MS all the way.

with python you have to choice of diffrent GUI libs. if you consider
wxWindows you can play around with the wxPython demo application that comes
with the download. on the other hand when you support win32 only the
win32all package has support for all the windows APIs and it has some
samples that get installed.

chris
--
Chris <clie...@gmx.net>

Cameron Laird

unread,
Sep 17, 2002, 5:49:15 PM9/17/02
to
In article <Xns928CED69254...@62.2.16.82>,
.
.
.
You can have Python *and* .Net. Well, probably; it's
been promised, and, to the extent anyone knew a year
ago what .Net is, Python's part of it.

While we're pointing out individual applications that
might be of interest, please keep in mind that Python
is in serious production use at tens of THOUSANDS of
sites. Don't judge it solely by what you see of the
first two demonstrations someone happens to push your
way.

Incidentally, Python *is* a "Microsoft solution".
There are plenty of people within Microsoft who use
Python because of its productivity in Win* contexts.
It's hard for me to give concrete references for this
claim; essentially all the people doing so describe
their efforts only "off the record". I'm willing to
bet, though, that Python will be around for longer
than VBScript.
--

Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html

Phil Thompson

unread,
Sep 17, 2002, 6:03:48 PM9/17/02
to

http://www.abo.fi/~iporres/Projects/fog0000000023.html

For SQL based applications PyQt contains a set of data aware widgets. PyQt
includes an example SQL browser, query, reporter in 180 lines of Python.

Phil

bap

unread,
Sep 17, 2002, 6:47:52 PM9/17/02
to
Actually both may be a solution. I've recently had good success at
developing an with a VB (not .net) front end and doing most of the
work in Python. Use each for what it's best at. Based on my experience with
project, I'd say that Python take about 25% of the code of VB to accomplish
the same objective. Plus Python objects tend to do what is expected so that
you can often guess at the syntax and be right whereas this is seldom true
with
VB objects.

Lee Gray <lpg...@uop.com> wrote in message
news:96904b50.02091...@posting.google.com...

Lee Gray

unread,
Sep 17, 2002, 8:42:42 PM9/17/02
to
Chris Liechti wrote:

Well, our shop is win32 only, but on a personal level I'd like to be more
flexible (I mostly use Linux at home). Isn't Tk still considered the
"official" GUI lib?

For a newbie, what's easier, Tk or wxWindows?

Thanks,
Lee

Lee Gray

unread,
Sep 17, 2002, 8:49:28 PM9/17/02
to
Cameron Laird wrote:

>>lpg...@uop.com (Lee Gray) wrote in
>>news:96904b50.02091...@posting.google.com:
>>> My boss is pretty open-minded, but also needs to see something working
>>> to be convinced Python is even a viable platform (he had never heard
>>> of it). Otherwise, .Net is a given, whether it's any good or not,
>>> since corporate is MS all the way.

> .
> While we're pointing out individual applications that
> might be of interest, please keep in mind that Python
> is in serious production use at tens of THOUSANDS of
> sites. Don't judge it solely by what you see of the
> first two demonstrations someone happens to push your
> way.

I read that all the time (and believe it), but that's not going to impress
my boss, much. He's still going to want something demonstrated up close and
personal.

> their efforts only "off the record". I'm willing to
> bet, though, that Python will be around for longer
> than VBScript.

I can certainly agree with that. There's already conflicting information
about MS' continuing support of VBS, the Windows Script Host and IE's HTAs
(HTML Applications) in the scripting newsgroups. That's one reason I want
to learn Python personally, but if we're going to use it at work, I need to
show something quickly to convince anyone (including myself!) that that's a
good direction.

Thanks,
Lee

Lee Gray

unread,
Sep 17, 2002, 8:50:59 PM9/17/02
to
Jay O'Connor wrote:

> In article <96904b50.02091...@posting.google.com>, "Lee Gray"
> <lpg...@uop.com> wrote:
>
>>
>> Can someone point me to a good Python GUI app to demonstrate (other than
>> IDLE)?
>
> Bioreason makes some products in Python. You can see some screenshots of
> their Python/Gtk products here: http://www.bioreason.com/lead.html and
> http://www.bioreason.com/drug.html
>

Thanks, I'll show those.

Lee

Lee Gray

unread,
Sep 17, 2002, 8:55:16 PM9/17/02
to
Phil Thompson wrote:

> On Tuesday 17 September 2002 10:05 pm, Lee Gray wrote:
>>
>> Can someone point me to a good Python GUI app to demonstrate (other
>> than IDLE)?
>

> http://www.abo.fi/~iporres/Projects/fog0000000023.html
>
> For SQL based applications PyQt contains a set of data aware widgets. PyQt
> includes an example SQL browser, query, reporter in 180 lines of Python.
>
> Phil

This looks very interesting!

Thanks,
Lee

Rob Hall

unread,
Sep 17, 2002, 9:17:01 PM9/17/02
to

> Well, our shop is win32 only, but on a personal level I'd like to be more
> flexible (I mostly use Linux at home). Isn't Tk still considered the
> "official" GUI lib?
>
> For a newbie, what's easier, Tk or wxWindows?

Yes, tkinter is the official one, but many believe it should be wxPython
(www.wxpython.org) . wxPython is an extremely good x-platform
implementation. It is fast, with a native look and feel.

wxpython also has some good ide packages. Boa is pretty good.
PythonCardPrototype is also very good.

If you use rational rose, I've started work on a python implementation. It
will also work with visual modeller.


Rob


Rob Hall

unread,
Sep 17, 2002, 9:19:36 PM9/17/02
to
> Actually both may be a solution. I've recently had good success at
> developing an with a VB (not .net) front end and doing most of the
> work in Python. Use each for what it's best at. Based on my experience
with
> project, I'd say that Python take about 25% of the code of VB to
accomplish
> the same objective. Plus Python objects tend to do what is expected so
that
> you can often guess at the syntax and be right whereas this is seldom true
> with
> VB objects.


Interesting... Can you point me to any links that may give me some pointers
in doing the same?

Rob


terry

unread,
Sep 17, 2002, 9:40:34 PM9/17/02
to

>> I'm willing to bet, though, that Python will be around for longer
>> than VBScript.

Cameron,

I don't like to disagree with an icon, but I think that you are missing
a deficiency in Python that will ultimatly limit it's usefullness in
the vast majority of the software that is written in the world.

As long as Python refuses to admit that money is the focus of most of
the world's software, Python will be relagated to the same status as
FORTRAN, BASIC, and etc - except COBOL and VB.

Is there any way to get the Python world to allow for the processing of
monetary applications without some hokey 60's constructs that involve
in-line conversions or anticipations of calculation characteristics?

Regards,

terry

Skip Montanaro

unread,
Sep 17, 2002, 10:09:41 PM9/17/02
to

Lee> Can someone point me to a good Python GUI app to demonstrate (other
Lee> than IDLE)?

Lee,

At IPC 10, Michel Sanner from Scripps took home the best paper award for his
ViPEr work. References:

http://www.python10.org/p10-awards.html
http://www.python10.org/p10-papers/10/index.htm
http://www.scripps.edu/~sanner/python/viper/index.html

--
Skip Montanaro
sk...@pobox.com
consulting: http://manatee.mojam.com/~skip/resume.html

David LeBlanc

unread,
Sep 17, 2002, 10:08:12 PM9/17/02
to
<snip>

> Is there any way to get the Python world to allow for the processing of
> monetary applications without some hokey 60's constructs that involve
> in-line conversions or anticipations of calculation characteristics?
>
> Regards,
>
> terry

What prevents the creation of a decimal money type? I agree, it would be
nice if python could do something akin to calculator aritmetic with types
like scientific (covered) engineering (improper scientific with the exponent
as a power of 3 and the (oops, forgot the term - mantissa?) more then a
single digit as in 12.2e3), fixed precision (1..n to the right of the
decimal). The forthcoming fractions are going to be interesting... (chinese
interpretation).

Be nice too if math could do rads, grads and decimal degrees.

Just my $0.02 worth.

Dave LeBlanc
Seattle, WA USA


Lee Gray

unread,
Sep 17, 2002, 11:20:02 PM9/17/02
to
Skip Montanaro wrote:

>
> Lee> Can someone point me to a good Python GUI app to demonstrate
> (other Lee> than IDLE)?
>
> Lee,
>
> At IPC 10, Michel Sanner from Scripps took home the best paper award for
> his
> ViPEr work. References:
>
> http://www.python10.org/p10-awards.html
> http://www.python10.org/p10-papers/10/index.htm
> http://www.scripps.edu/~sanner/python/viper/index.html
>

Very nice! Thanks for the ref.

Lee

Dennis Reinhardt

unread,
Sep 18, 2002, 12:48:27 AM9/18/02
to
> > is in serious production use at tens of THOUSANDS of
> > sites.

> I read that all the time (and believe it), but that's not going to impress


> my boss, much. He's still going to want something demonstrated up close
and
> personal.

Would he be impressed by a user interface that powers 2.1 BILLION web
documents? (ref: alltheweb.com)

I am about 2 weeks away from releasing HTUIL, an integrated client for
Windows, hosting Python, Perl, and/or native PLD2 displaying in a standard
web browser. See www.dair.com/hellopy.exe for a "hello" program written in
Python and distributed as a standalone EXE on Windows.

--

Dennis Reinhardt

http://www.dair.com


terry

unread,
Sep 18, 2002, 12:47:48 AM9/18/02
to

>> Dave LeBlanc wrote:
>> What prevents the creation of a decimal money type?

Absolutely nothing! And it has been done - sort of.

The problem involves the resultant code to implement a business
application. In the simple situation, all the developer has to do is
be aware on <every> calculation what specific type of variables are
being used ( integers for quantities, reals for percentages, etc...)
and what the result 'should' be - and then apply the appropriate
conditioning to the variables in the calculation and to the result.
You can surely contemplate the variability in programming styles and
implementations that this generates - most of which flies in the face
of the simplicity and readability promised by Python. Contrast that
with the following VB code: Amount = Qty * UnitPrice

The more difficult problem arises when faced with a true quality
assurance environment. The amount of validation rises exponentially
when the calculations in a program are implementation specific, as
opposed to language intrinsics. Each calculation must be tested at the
limits of each of the variables involved - at each instance.

The quick reply to your observation is: Yes, anything is possible -
but is forcing a language into an environment to which it is not
intrinsicly suited a reasonable approach? All of the databases, that
Python can easily talk to, have a form of monetary data type. But when
those table fields are represented in Python (as well as some other
languages) they become a burden.

I think Python needs to incorporate an intrinsic data type that
monetary (as well as other decimal data types) can be represented by,
so that the above equation yields results consistent with the decimal
places of the input variables. This cannot be accomplished with
real/floats, and shouldn't be accomplished with overlays on integer or
character variable types. Python needs this data type, that is not
hardware oriented, to become truly mainstream and be a threat to VB.

I say this with all due respect to all the other positive attributes of
Python and it's flexibility to solve a myriad of other non-business
application problems.

terry

Alex Martelli

unread,
Sep 18, 2002, 2:59:15 AM9/18/02
to
David LeBlanc wrote:
...

> What prevents the creation of a decimal money type? I agree, it would be

Nothing prevents it. In particular, nothing prevents implementing such
a type in Python itself. There are various implementations of decimal
numbers around, including one (not sure how mature and complete) that
meets the standards for decimal arithmetic behavior (as per the IBM Rexx
implementation). It seems to me a relatively simple problem, compared
with many others that are routinely solved by Python programmers. If
there's no single "best of breed" Currency extension that dominates the
scene (as, for example, Lemburg's mxDateTime dominates the date-time
handling scene) I suspect it must be because of a lack of demand, strange
as it may seem. Defining new types is SO easy...

So prove my suspicion wrong: pick an almost-there implementation,
complete it per your specs, release it, and see it take over the
world. How much effort can it be...?

> nice if python could do something akin to calculator aritmetic with types
> like scientific (covered) engineering (improper scientific with the
> exponent as a power of 3 and the (oops, forgot the term - mantissa?) more

That's just an issue of display, isn't it? Computations are just the
same whether the calculator is set to always display exponents as a
power of three, or not -- at least, that's how I recall my calculator
worked: a single button switched display mode from scientific to
engineering and back, but all numbers in the calculator's stack and
registers were supremely unaffected by it.

> then a single digit as in 12.2e3), fixed precision (1..n to the right of
> the decimal). The forthcoming fractions are going to be interesting...
> (chinese interpretation).

If by "fractions" you mean Rationals, that's another thing yet.


> Be nice too if math could do rads, grads and decimal degrees.

That's a completely different issue: math is a module, not a type.
In this case, what you want is simply a different module that wraps
math and multiplies/divides some arguments or results by appropriate
conversion factors. Still a pretty modest programming effort (all
of, what, 10 minutes...?). Modifying the math module to behave this
way upon some switch set in it should not be much more.


> Just my $0.02 worth.

If you really think, just to take a simple example, that having
a sin function that accepts degrees rather than radians is
important for Python, why not just take the 10 minutes to
implement that (or 20 minutes, if you're keep to modify rather
than wrap the math module) and thus prove I'm wrong in suspecting
that such a project would be pretty much useless...?

I'll even volunteer to perform the programming part of the task
(not a huge commitment:-) if you undertake to deal with testing,
documentation, and advocacy (to get it widely used, and in the
long run to get it into the core by popular demand).


Alex

Eric Brunel

unread,
Sep 18, 2002, 4:46:36 AM9/18/02
to
Lee Gray wrote:
[snip]

> For a newbie, what's easier, Tk or wxWindows?

Matter of taste, really... I do prefer Tkinter, because I find it far
simpler than other GUI toolkits. But then, I've been into Tk for some years
now, and maybe I'm too used to it.

The first time I've looked at wxWindows and seen what's needed to open a
simple window, it just made me run away screaming ;-). But seeing it again
now, it's not that bad. See:

http://www.wxpython.org/tut-part1.php

In fact, example one in this tutorial would be much shorter in Tkinter than
in wxWindows, but examples 2 & 3 would require much more code in pure
Tkinter because of the status bar: it's apparently automatically managed by
wxWindows, but not by Tkinter. Adding Pmw to Tkinter would make things
easier ( see http://pmw.sourceforge.net ).

For the record, here is the equivalent (untested) Tkinter+Pmw code for
examples 1 & 3 in the wxPython tutorial:

--- example 1 -------------------------
from Tkinter import *

topWdw = Tk()
topWdw.title("Hello from Tkinter")
topWdw.mainloop()
----------------------------------------

--- example 3 -------------------------
from Tkinter import *
import Pmw

## Main window
topWdw = Tk()
topWdw.title("Hello from Tkinter")
## Status bar
statusBar = Pmw.MessageBar(topWdw)
statusBar.pack(side=BOTTOM, fill=X)
## Helper for menu items
helper = Pmw.Balloon(topWdw)
helper.configure(statuscommand=statusBar.helpmessage)
## Function displaying about screen
def showAbout():
showinfo('About Me', "This sample program shows off\n"
"frames, menus, statusbars, and this\n"
"message dialog.")
## Menus
menuBar = Pmw.MainMenuBar(topWdw, balloon=helper)
topWdw.configure(menu=menuBar)
menuBar.addmenu('File', '')
menuBar.addmenuitem('File', 'command',
'More information about this program',
label='About', command=showAbout)
menuBar.addmenuitem('File', 'separator')
menuBar.addmenuitem('File', 'command',
'Terminate the program',
label='Exit', command=topWdw.quit)
topWdw.mainloop()
---------------------------------------

Just see for yourself the one you find clearer.

HTH
--
- Eric Brunel <eric....@pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

Fred Pacquier

unread,
Sep 18, 2002, 3:20:00 AM9/18/02
to
lpg...@uop.com (Lee Gray) said :

> I'm a fairly new programmer with experience in ASP/VBScript/DHTML.
> Other than small utilities, so far I've mostly written ASP apps to
> talk to an Oracle database on HP/UX, with Windows NT/2000 clients, and
> I've done maintenance work on VB and Oracle Forms apps.
> We're currently looking at .Net, and I'm not very impressed, for a
> variety of reasons. A little research makes me feel that either Java
> or Python would be a good alternative, and given my level of
> experience, I'd much prefer Python over Java. I *think* I could
> actually get up to speed faster with Python than with VB and ASP.Net,
> in spite of my ASP/VBS experience.
> My boss is pretty open-minded, but also needs to see something working
> to be convinced Python is even a viable platform (he had never heard
> of it). Otherwise, .Net is a given, whether it's any good or not,
> since corporate is MS all the way.
> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

In addition to what's already been suggested, you may want to look at the
"samples" (demos) in the PythonCard distribution. They're small apps, but
quite demonstrative, especially considering the size of the code and ease
of use :

http://pythoncard.sourceforge.net/

Of course, PythonCard is based on wxPython, and that has a nice showcase
demo suite as well.

Finally, a nice (very VB-like) IDE for wxPython is Boa Constructor,
although you'll need to pull the matest version from CVS :

http://boa-constructor.sourceforge.net/

HTH,
fp

--
YAFAP : http://www.multimania.com/fredp/

G. Willoughby

unread,
Sep 18, 2002, 7:43:16 AM9/18/02
to
> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

I wrote a GUI interface to another python console app to create maps for an
online game by reading the installed in-game graphics, 3D model and terrain
data, see it here:

http://www.thecalm.fsnet.co.uk/MapperGUI

--G. Willoughby


Rob Hall

unread,
Sep 18, 2002, 7:51:16 AM9/18/02
to

> Matter of taste, really... I do prefer Tkinter, because I find it far
> simpler than other GUI toolkits. But then, I've been into Tk for some
years
> now, and maybe I'm too used to it.
>

Yes I agree. It is a matter of taste to some extent. I evaluated both,
coming from a position of not knowing either, and wx seemed much simpler to
me.

Also, PythonCardPrototype is an excellent system for using wx. It puts a
lot of the hard work in a separate file, letting you concentrate more on the
application logic.


> The first time I've looked at wxWindows and seen what's needed to open a
> simple window, it just made me run away screaming ;-).

I did that with tkinter. I ran, and ran. Then I found wx. I thought it
wasn't so bad. Then when I looked at tk again, it didn't seem too bad
either.


I settled on wx for the following reasons...
- I needed to settle on something, and pretty soon
- wx has a native look and feel
- wx is fast - compiled C++, whereas tkinter is a script. I found it to be
almost unacceptably slow in some instances.
- PythonCardPrototype would simplify things even further.

Rob


Alan James Salmoni

unread,
Sep 18, 2002, 8:07:29 AM9/18/02
to
Lee,

I don't know if this is the kind of thing you are looking for, but I've
written an application for statistical analysis (the scientific kind)
which is available for download from http://salstat.sunsite.dk
(screenshots are available too). It's GPL'd, but rather new so there are
still some rough edges. The GUI was written using wxPython (absolutely
fantastic IMHO - the learning curve is a bit steep to begin with, but
shallows extremely quickly). Features:

* A spreadsheet like grid for data entry/display
* A html display window for the output of the analysis and the online
help pages
* Custom dialog boxes for each set of analyses
* Standard dialogs (file open/save and font choser)
* The GUI took a few weeks to write part-time and that was from scratch
while learning wxPython. And I'm a psychologist, not a programmer, which
means you will probably be up to speed in much less time ;).
* A windows installer containing all the required program (ie, non-icon
or help) files for a Windows box in one file (using the McMillan installer)
* Cross-platform capability - Windows, Linux and OSX (the OSX wasn't
even planned - it just happened to work!)

Have fun!

Alan.

Jerome Alet

unread,
Sep 18, 2002, 8:19:09 AM9/18/02
to
Lee Gray wrote:
>
> I'm a fairly new programmer with experience in ASP/VBScript/DHTML.
> Other than small utilities, so far I've mostly written ASP apps to
> talk to an Oracle database on HP/UX, with Windows NT/2000 clients, and
> I've done maintenance work on VB and Oracle Forms apps.

Perhaps this is really silly, but why don't you show Zope to your boss ?

http://www.zope.org/

not really a GUI, though

hth

Jerome Alet

Cameron Laird

unread,
Sep 18, 2002, 8:34:38 AM9/18/02
to
In article <mailman.1032311543...@python.org>,
.
.
.
If it helps, I have a soft spot for OS/400. I spent the
early '80s writing BCD arithmetic packages in various
assemblers.

Terry, who needs disagreement more urgently than an icon?

You and others have raised this point before. I haven't
taken it as seriously as I should, just because I know
that Microsoft and Sun (among others) are utterly unsympa-
thetic to it. I need to ponder that ... anomaly (?) more.
Thanks for making an issue of it.

Fred Pacquier

unread,
Sep 18, 2002, 8:53:54 AM9/18/02
to
"Rob Hall" <bl...@ii.net> said :

> I settled on wx for the following reasons...
> - I needed to settle on something, and pretty soon
> - wx has a native look and feel
> - wx is fast - compiled C++, whereas tkinter is a script. I found it

> - to be

> almost unacceptably slow in some instances.
> - PythonCardPrototype would simplify things even further.

not "would" -- "does" :-)

--
YAFAP : http://www.multimania.com/fredp/

Colin J. Williams

unread,
Sep 18, 2002, 11:05:30 AM9/18/02
to
You might look at:
http://www.scopal.com/information06.htm

A digital oscilloscope is controlled by a PC, using wxPython
and Python.

Colin W.

bap

unread,
Sep 18, 2002, 11:27:57 AM9/18/02
to
Does wx work with ActiveState Python? I tried to use and as soon as
wxWindows imports, Python (2.2)
bombs and your back out at Windows with no error message. On another group I
was
told that this is a known issue and wxWindows doesn't work with Active State
Python.

Rob Hall <bl...@ii.net> wrote in message
news:3d8868b1$0$28...@echo-01.iinet.net.au...

Gerhard Häring

unread,
Sep 18, 2002, 11:42:11 AM9/18/02
to
"bap" wrote:
> Does wx work with ActiveState Python?

Works for me (wxPython 2.3.2.1, Python 2.2.1 from ActiveState, Windows 2000
SP3).

-- Gerhard

jason petrone

unread,
Sep 18, 2002, 12:04:10 PM9/18/02
to
Lee Gray <lpg...@uop.com> wrote:
> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

You could bring him the Star Wars: Episode II DVD:
http://www.python.org/Quotes.html

A few other polished programs written in python:

Visual Python: http://www.activestate.com/Products/Visual_Python/
PySol: http://www.oberhumer.com/opensource/pysol/
Sketch: http://sketch.sourceforge.net/
Grail: http://grail.sourceforge.net/

Visual Python probably has the prettiest screenshot.

Jason

ChrisBarker

unread,
Sep 18, 2002, 1:01:01 PM9/18/02
to
terry wrote:

> Contrast that
> with the following VB code: Amount = Qty * UnitPrice

> The amount of validation rises exponentially

> when the calculations in a program are implementation specific, as
> opposed to language intrinsics. Each calculation must be tested at the
> limits of each of the variables involved - at each instance.

Well, sure. This is obviously a stupid way to go about...That's what
object oriented programming is all about. What you need to do is create
a currency class that behaves like it should, and then use it everywhere
you want currency. Then you can do:

Amount = Qty * UnitPrice

just like VB.

> The quick reply to your observation is: Yes, anything is possible -
> but is forcing a language into an environment to which it is not
> intrinsicly suited a reasonable approach?

This is not an issue of suitability of Python.

> I think Python needs to incorporate an intrinsic data type that
> monetary

Yes, it would be4 very useful to have that data type, but it really
doesn't make any difference whether it is intrinsic or not.


> and shouldn't be accomplished with overlays on integer or
> character variable types.

Why not? what do you think VB is doing? All machines that VB runs on use
binary integer and floating point arithmetic..so a currency data type
HAS to be based on those. It's just a question of whether you write the
"overlays" in Python, C, assembly, or whatever. And you are free to
extend Python in those languages if you like. The only reason I can see
to not writing your class in Python is performance, and unless you are
doing a lot of calculations, that is probably a non-issue.

If someone writes a nice one, maybe it could even be put intot he
standard library.

> Python needs this data type, that is not
> hardware oriented, to become truly mainstream and be a threat to VB.

Python needs the equivalent of the MS marketing machine to be a "threat"
to VB.

> I say this with all due respect to all the other positive attributes of
> Python and it's flexibility to solve a myriad of other non-business
> application problems.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris....@noaa.gov

Robin Becker

unread,
Sep 18, 2002, 2:56:06 PM9/18/02
to
In article <vATh9.666$oY5.33...@newssvr14.news.prodigy.com>, Dennis
Reinhardt <Den...@dair.com> writes
.......

>
>Would he be impressed by a user interface that powers 2.1 BILLION web
>documents? (ref: alltheweb.com)
>
>I am about 2 weeks away from releasing HTUIL, an integrated client for
>Windows, hosting Python, Perl, and/or native PLD2 displaying in a standard
>web browser. See www.dair.com/hellopy.exe for a "hello" program written in
>Python and distributed as a standalone EXE on Windows.
>
>--
>
>Dennis Reinhardt

Well hoping Dennis is genuine and has better control over virii than my
outdated anti-virals I tried running this 360k hello world.

Now I'm confused, I have K-Meleon 0.6 installed as my standard, but
hellopy.exe tries to use Netscape 4.78 (also installed on my machine)
and fails to display anything properly (I see the source in the browser
window).

Probably one of those pesky registry settings over which only Billy
Goats has any control.
--
Robin Becker

Lee Gray

unread,
Sep 18, 2002, 3:24:48 PM9/18/02
to
Jerome Alet <al...@unice.fr> wrote in message news:<3D886F3D...@unice.fr>...


> Perhaps this is really silly, but why don't you show Zope to your boss ?
>
> http://www.zope.org/
>
> not really a GUI, though
>
> hth
>
> Jerome Alet

I've heard of, but know nothing about Zope. I don't think it's really
applicable. I need a client GUI app to have him get the feel of
what's possible; and the back-end (Oracle DB) isn't going to change.

Thanks though,
Lee

Lee Gray

unread,
Sep 18, 2002, 3:28:26 PM9/18/02
to
Chris Liechti <clie...@gmx.net> wrote in message news:<Xns928CED69254...@62.2.16.82>...
> lpg...@uop.com (Lee Gray) wrote in
> news:96904b50.02091...@posting.google.com:

> > My boss is pretty open-minded, but also needs to see something working
> > to be convinced Python is even a viable platform (he had never heard
> > of it). Otherwise, .Net is a given, whether it's any good or not,
> > since corporate is MS all the way.
>
> with python you have to choice of diffrent GUI libs. if you consider
> wxWindows you can play around with the wxPython demo application that comes
> with the download. on the other hand when you support win32 only the
> win32all package has support for all the windows APIs and it has some
> samples that get installed.
>
> chris

I've been playing with wxWindows and Boa Constructor. wxWindows is
pretty darn cool and will make a good demo for him. Boa looks good
but is still a bit rough (naturally, being alpha), but I'm looking
forward to future releases.

Thanks,
Lee

Lee Gray

unread,
Sep 18, 2002, 3:50:00 PM9/18/02
to
lpg...@uop.com (Lee Gray) wrote in message news:<96904b50.02091...@posting.google.com>...

> I'm a fairly new programmer with experience in ASP/VBScript/DHTML.
[...]
> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

Thanks for all the suggestions, folks!

I've collected lots of links to a variety of very nice screenshots,
and I've been playing with the wxWindows demo and Boa Constructor. Boa
was a bit disappointing, not as an app, but because of its current
alpha status - but it's got great potential and I'll definitely look
forward to future releases. I'll check out PythonCard too.

Regarding .Net AND Python, that's certainly a possibility down the
road, but unfortunately I don't have the time to devote to learning
both at the moment, and if we definitely go .Net, no one (besides me)
is going to see any value in adding Python.

Thanks again... and feel free to send more ideas!
Lee

bru...@tbye.com

unread,
Sep 18, 2002, 5:05:17 PM9/18/02
to

wxDesigner is also pretty nice (http://www.roebling.de).

-Dave


Gray, Lee P.

unread,
Sep 18, 2002, 4:35:59 PM9/18/02
to
(Sorry for the screwed up quoting... I have to use Outlook at work.
:( )

> From: Christian Tismer [SMTP:tis...@tismer.com]
> Sent: September 18, 2002 3:14 PM
> To: Lee Gray
> Cc: pytho...@python.org
> Subject: Re: Python GUI app to impress the boss?
>
> Boa is in fact quite a bit alpha-ish, but after you're
> used to the quirks and limitations, it is really great.
> Also note that you should use the version from CVS
> which is *far* more developed than the downloadable.
>
> I've written a quite big wizard for 3D image processing
> with wxPython, PIL, Stackless. If you like, I can prepare
> some screen shots.
>
[Gray, Lee P.] ---------------
Yeah, I tried to download from CVS, but being a complete noob
couldn't figure out how, short of tracking down and copying and pasting
every updated file. Any tips would be appreciated.

Yes, I'd definitely like to see your screenshots.

Thanks,
Lee

Christian Tismer

unread,
Sep 18, 2002, 4:14:11 PM9/18/02
to
Lee Gray wrote:
...

> Thanks for all the suggestions, folks!
>
> I've collected lots of links to a variety of very nice screenshots,
> and I've been playing with the wxWindows demo and Boa Constructor. Boa
> was a bit disappointing, not as an app, but because of its current
> alpha status - but it's got great potential and I'll definitely look
> forward to future releases. I'll check out PythonCard too.

Boa is in fact quite a bit alpha-ish, but after you're


used to the quirks and limitations, it is really great.
Also note that you should use the version from CVS
which is *far* more developed than the downloadable.

I've written a quite big wizard for 3D image processing
with wxPython, PIL, Stackless. If you like, I can prepare
some screen shots.

ciao - chris
--
Christian Tismer :^) <mailto:tis...@tismer.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34 home +49 30 802 86 56 pager +49 173 24 18 776
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/

Chris Liechti

unread,
Sep 18, 2002, 5:54:01 PM9/18/02
to
"Gray, Lee P." <lpg...@UOP.com> wrote in
news:mailman.1032381445...@python.org:

>> Boa is in fact quite a bit alpha-ish, but after you're
>> used to the quirks and limitations, it is really great.
>> Also note that you should use the version from CVS
>> which is *far* more developed than the downloadable.
>
> Yeah, I tried to download from CVS, but being a complete noob
> couldn't figure out how, short of tracking down and copying and pasting
> every updated file. Any tips would be appreciated.

you're on windows right? then grab http://tortoisecvs.sf.net and install
the latest version. after that right click on an empty folder in the
windows explorer and select "cvs checkout", copy and paste the "CVSROOT" in
the dialog. you can find the cvsroot, or at least how it looks like on the
"browse cvs" page that you have apparently found.

the home of cvs is http://www.cvshome.org and these are interesting sites:
http://www.loria.fr/~molli/cvs-index.html, http://cvsbook.red-bean.com/

chris

--
Chris <clie...@gmx.net>

Dennis Reinhardt

unread,
Sep 18, 2002, 5:57:43 PM9/18/02
to
> Well hoping Dennis is genuine and has better control over virii than my
> outdated anti-virals I tried running this 360k hello world.
I think I am genuine. The base code compiles entirely from source in the
PLD2 compiler language I developed (www.pld2.com); I think I have adequate
control.

> Now I'm confused, I have K-Meleon 0.6 installed as my standard, but
> hellopy.exe tries to use Netscape 4.78 (also installed on my machine)
> and fails to display anything properly (I see the source in the browser
> window).

Netscape instead of K-Meleon is a "registry thing". The code is looking for
the association of ".htm" and running whatever the associated program is. I
suspect if you have a local file called eggs.htm, that Netscape comes up
when you double click the file. Perhaps K-Meleon comes up if you click
spam.html. I dunno but the program is looking no further than the "open"
verb of .htm.

I have duplicated your experience with both Netscape and Opera on Win98. I
have neither a fix nor a facile explanation at this time. I have repeatedly
run both browsers on other CGI code in both Perl and native PLD2. I suspect
a recent change here is at fault. I am working on fixing this now and will
let you know.

Thanks very much for the report.
--

Dennis Reinhardt

Den...@dair.com
http://www.dair.com


Fernando Pérez

unread,
Sep 18, 2002, 6:14:10 PM9/18/02
to
Lee Gray wrote:

>
> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

Why don't you look at MayaVi (http://mayavi.sourceforge.net)? It's very
impressive, and runs both under Un*x and Windows. It's a great show of
python's strenghts: use Tk for the GUI, Vtk for the heavy lifting (3d
rendering) and python for all the logic elsewhere which isn't super intensive
computationally.

Cheers,

f.

Lee Gray

unread,
Sep 18, 2002, 7:10:36 PM9/18/02
to
Chris Liechti wrote:

> "Gray, Lee P." <lpg...@UOP.com> wrote in

>> Yeah, I tried to download from CVS, but being a complete noob
>> couldn't figure out how, short of tracking down and copying and pasting
>> every updated file. Any tips would be appreciated.
>
> you're on windows right? then grab http://tortoisecvs.sf.net and install
> the latest version. after that right click on an empty folder in the
> windows explorer and select "cvs checkout", copy and paste the "CVSROOT"
> in the dialog. you can find the cvsroot, or at least how it looks like on
> the "browse cvs" page that you have apparently found.
>
> the home of cvs is http://www.cvshome.org and these are interesting sites:
> http://www.loria.fr/~molli/cvs-index.html, http://cvsbook.red-bean.com/

Yep, Windows at work, mostly Linux at home. I'll check this out at work
tomorrow.

Thanks for the info!
Lee

Fred Pacquier

unread,
Sep 19, 2002, 7:47:04 AM9/19/02
to
lpg...@uop.com (Lee Gray) said :

> Thanks for all the suggestions, folks!
>
> I've collected lots of links to a variety of very nice screenshots,
> and I've been playing with the wxWindows demo and Boa Constructor. Boa
> was a bit disappointing, not as an app, but because of its current
> alpha status - but it's got great potential and I'll definitely look
> forward to future releases. I'll check out PythonCard too.

This just in : the Python Daily URL (http://www.pythonware.com/daily/)
mentions this collection of classes and tools for UML modeling and
programming. I don't understand it all, but the sceenshot of the graphical
model editor sure is a killer :-)

http://www.abo.fi/~iporres/Projects/fog0000000023.html

--
YAFAP : http://www.multimania.com/fredp/

Dennis Reinhardt

unread,
Sep 19, 2002, 5:44:26 PM9/19/02
to
> I have duplicated your experience with both Netscape and Opera on Win98.
I
> have neither a fix nor a facile explanation at this time. I have
repeatedly
> run both browsers on other CGI code in both Perl and native PLD2. I
suspect
> a recent change here is at fault.

The server code for implementing CGI style headers was incorrectly
implemented. This is not a recent change but, rather, incorrect coding.
When I posted the code URLs, I believed that I had "repeatedly run both
browsers on other CGI code...". At this point, I can only conclude that the
CGI code has been run on IE only (where it does work despite the header
errors).

Rather than rush a fix here, I am going to hold off reposting until I have
done a proper release. The files sample files whose URLs have previously
been given have been deleted so that no one else serves as an inadvertent
beta tester.

I am sorry for posting immature code.

Lee Gray

unread,
Sep 19, 2002, 7:38:12 PM9/19/02
to
Fred Pacquier wrote:

Hehe... yep, that was one of 'em I bookmarked.

Lee

Robin Dunn

unread,
Sep 19, 2002, 10:24:20 PM9/19/02
to
Lee Gray wrote:
[...]

> Can someone point me to a good Python GUI app to demonstrate (other
> than IDLE)?

There are some new screen shots of apps written in wxPython at
http://wxpython.org/screenshots.php

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn

unread,
Sep 19, 2002, 10:24:39 PM9/19/02
to
Lee Gray wrote:
>
> For a newbie, what's easier, Tk or wxWindows?
>

I've found that it depends on how your brain is wired. There are some
people who love Tkinter because it just fits the way they think but just
can't understand wxPython no matter how much they try. There are other
folks where the opposite is true, I am one of them and that is the main
reason wxPython was created.

Rob Hall

unread,
Sep 19, 2002, 10:31:01 PM9/19/02
to
Hi.

> I've written a quite big wizard for 3D image processing
> with wxPython, PIL, Stackless.

I wouldn't mind a look - whats the address for your wizzard?

Rob


Robin Dunn

unread,
Sep 19, 2002, 11:41:10 PM9/19/02
to
bap wrote:
> Does wx work with ActiveState Python? I tried to use and as soon as
> wxWindows imports, Python (2.2)
> bombs and your back out at Windows with no error message. On another group I
> was
> told that this is a known issue and wxWindows doesn't work with Active State
> Python.

It has trouble running within the PythonWin GUI, but works just fine
with the Python interpreter itself.

Magnus Lyckå

unread,
Sep 20, 2002, 6:37:19 AM9/20/02
to
jason petrone wrote:
> A few other polished programs written in python:
>
> Visual Python: http://www.activestate.com/Products/Visual_Python/
...

> Visual Python probably has the prettiest screenshot.

Stop there! Visual Python is a python plugin for Microsoft
Visual Studio, right? So what you see is Visual Studio,
which is AFAIK written in C++ with MFC. Or am I in deep
waters here? I think it's written _for_ python, not _in_
python.

Magnus Lyckå

unread,
Sep 20, 2002, 8:31:51 AM9/20/02
to
ChrisBarker wrote:
> The only reason I can see
> to not writing your class in Python is performance, and unless you are
> doing a lot of calculations, that is probably a non-issue.

Performance issues might well matter in large financial
systems, but that's not the only reason. If we want a
statement like

x = 5 * 2.43

to yield an exact decimal number, and not a float, we can't
get away with a Python class.

Ok, you might say that it's not a big thing to write

x = 5 * Decimal(2.43)

instead, but it's not quite the same thing. And if someone
would write

x = Decimal(9.999999999999999) - Decimal(9.9999)

they would not get what they expected (unless they
expected 0.000099999999998). Ok, they could write

x = Decimal('9.999999999999999') - Decimal('9.9999')

but now it's starting to look pretty ugly compared to

x = 9.999999999999999 - 9.9999

Python is claimed to use the principle of least surprise:
Thus 1 / 2 is being changed from meaning 0 to meaning 0.5.
Quite a few people have expressed their surprise over things
like

>>> 0.9
0.90000000000000002

and reported it as a bug. Floating point arithmetic is
surprising to a lot of people. It's annoying when people
report this behaviour as a bug. It's worse if it leads
them to make buggy programs. Particularly if they are
used at your bank!

I've seen ambitious and appreciated programmers with a
non-technical background doing things like
"if (a == (b / 5))" in tools that create C++ using
doubles for a and b.

Python is in many ways an excellent language for people
who are beginners at programming, or not full time
programmers. It would be great if we could remove some
more of the remaining stumbling blocks.

What you see as a natural restriction, completely logic,
is an evil, subtle and completely absurd bug to some people.

I don't want to break a lot of existing code though.

It's boring if we have to change a lot of 3.14 to 3.14e0.
That's hardly acceptable before Python 3.0.

But perhaps a command line argument or something like
"import exact_arithmetic" could change the behaviour to
using exact instead of floating point arithmetic. I guess
we'd need a module anyway, to specify things. Like:

>>> import exact_arithmetics as exact
>>> exact.default_rounding(exact.UP)
>>> exact.default_fractions(2)
>>> exact.max_precision = 20
>>> 7.5/20
0.38
>>>

Paul Rubin

unread,
Sep 20, 2002, 8:44:36 AM9/20/02
to
Magnus Lyckå <mag...@thinkware.se> writes:
> Ok, you might say that it's not a big thing to write
>
> x = 5 * Decimal(2.43)
>
> instead, but it's not quite the same thing.

It would have to be x = 5 * Decimal('2.43')

Dan Bishop

unread,
Sep 20, 2002, 3:28:44 PM9/20/02
to
Magnus Lyckå <mag...@thinkware.se> wrote in message news:<3D8B1537...@thinkware.se>...

> ChrisBarker wrote:
> > The only reason I can see
> > to not writing your class in Python is performance, and unless you are
> > doing a lot of calculations, that is probably a non-issue.
>
> Performance issues might well matter in large financial
> systems, but that's not the only reason.

Please name one other real-world situation in which decimal arithmetic
is actually *needed*.

> [snip]


> And if someone would write
>
> x = Decimal(9.999999999999999) - Decimal(9.9999)
>
> they would not get what they expected (unless they
> expected 0.000099999999998). Ok, they could write

But how often does an error of 10 parts per trillion really matter?

Afaict, not nearly enough to justify having a default number
representation that works against the hardware.

> [major snippage]

> But perhaps a command line argument or something like
> "import exact_arithmetic" could change the behaviour to
> using exact instead of floating point arithmetic. I guess
> we'd need a module anyway, to specify things. Like:
>
> >>> import exact_arithmetics as exact
> >>> exact.default_rounding(exact.UP)
> >>> exact.default_fractions(2)
> >>> exact.max_precision = 20
> >>> 7.5/20
> 0.38
> >>>

In your proposal, is 1/3 exact? How about sqrt(2)?

What's so important about terminating decimal fractions that they
should get special treatment? It's true that they're useful for
currency calculations, but isn't a Money class enough?

Christopher Browne

unread,
Sep 20, 2002, 7:54:55 PM9/20/02
to
In an attempt to throw the authorities off his trail, dan...@yahoo.com (Dan Bishop) transmitted:

> Magnus Lyckå <mag...@thinkware.se> wrote in message news:<3D8B1537...@thinkware.se>...
>> ChrisBarker wrote:
>> > The only reason I can see
>> > to not writing your class in Python is performance, and unless you are
>> > doing a lot of calculations, that is probably a non-issue.
>>
>> Performance issues might well matter in large financial
>> systems, but that's not the only reason.
>
> Please name one other real-world situation in which decimal arithmetic
> is actually *needed*.
>
>> [snip]
>> And if someone would write
>>
>> x = Decimal(9.999999999999999) - Decimal(9.9999)
>>
>> they would not get what they expected (unless they expected
>> 0.000099999999998). Ok, they could write

> But how often does an error of 10 parts per trillion really matter?

> Afaict, not nearly enough to justify having a default number
> representation that works against the hardware.

This isn't thinking like an ex-COBOL programmer.

An ex-COBOL programmer will look at this and say something like:

"You stupid buffoons! You're arguing over how to deal with some
abstruse fifteenth decimal place. In COBOL, we never had to worry
about such idiocy concerning the numeric /error/ that you're
describing.

If we're working with dollars and cents, we define the variable as:

X PIC 999999999V99

And we will have none of these idiotic rounding errors."

Add X to a variable with the same format, and there's NO issue of bad
rounding. The behaviour of BCD arithmetic is perfectly well defined,
and _doesn't_ depend on hoping and praying that the IEEE FP operations
will do approximately the right thing.

The COBOL (or PL/I, or anyone else accustomed to BCD data types) guy
will justifiably look at the bizarro FP rounding as being, well,
bizarre.

There's _no_ good reason for subtracting two perfectly good decimal
values from one another to result in having weird artifacts appear in
some 17th decimal place, aside from having a willingness to admit
fairly deranged arithmetic.

People use FP arithmetic making the ludicrous assumption that FP
values are "Real numbers." They aren't, despite some languages that
call them REALs. They also generally aren't decimal values, but
rather binary fractions, from whence enters the bizarre artifacts of
FP.

I think there's a good argument for the idea that people should
generally be flogged mercilessly if they use FP values without having
had a /good/ education in numerical analysis which is /necessary/ in
order to be able to competently use them.
--
(concatenate 'string "cbbrowne" "@cbbrowne.com")
http://cbbrowne.com/info/unix.html
"It don't mean a thing, if it ain't got that swing..."

Paul Rubin

unread,
Sep 20, 2002, 8:33:46 PM9/20/02
to
Christopher Browne <cbbr...@acm.org> writes:
> The COBOL (or PL/I, or anyone else accustomed to BCD data types) guy
> will justifiably look at the bizarro FP rounding as being, well,
> bizarre.
>
> There's _no_ good reason for subtracting two perfectly good decimal
> values from one another to result in having weird artifacts appear in
> some 17th decimal place, aside from having a willingness to admit
> fairly deranged arithmetic.

Um, put $1000.00 in an imagined bank account and have it collect 5%
annual interest, compounded daily for 25 years. How much money is in
the account at the end?

The "true" answer is (1+(.05/365))**(365*25) dollars, assuming 365 day
years.

The IEEE double precision answer will be extremely close to that
amount.

What happens if you do that calculation in BCD? How would you even
specify how to do it? I don't think you will get nearly as much
accuracy.

Christopher Browne

unread,
Sep 20, 2002, 11:39:48 PM9/20/02
to

REALITY CHECK for a moment.

What do you think A Real Live bank uses to compute interest?
Financial transactions are most certainly /not/ computed based on the
quasi-infinite precision that you are imagining.

Were you expecting IEEE double precision arithmetic, applied over the
period of 25 years?

Or perhaps, instead, might they use BCD arithmetic, applied on each
date that interest is to be accrued?

If I put $1000 in a /real/ bank account, earning 5% interest,
compounded daily, paid monthly, it is more than just /slightly/ likely
that the bank in question would, using code likely written in PL/I or
COBOL, put money into the account every month, with amounts rounded
based on BCD arithmetic.

The "true answer" will most certainly be the BCD-based answer; that's
the amount of money you'd have in the account 25 years later.

If you protest that the "true" answer is supposed to be
(1+(.05/365))**(365*25) dollars, and that the bank is short-changing
you by 7 cents, the bank will quite glibly tell you to look at the
interest policy, which /won't/ be based on waiting 25 years to apply
the interest.
--
(reverse (concatenate 'string "gro.mca@" "enworbbc"))
http://cbbrowne.com/info/oses.html
One man's constant is another man's variable. -- Alan Perlis

Paul Rubin

unread,
Sep 21, 2002, 1:34:10 AM9/21/02
to
Christopher Browne <cbbr...@acm.org> writes:
> REALITY CHECK for a moment.
>
> What do you think A Real Live bank uses to compute interest?

If I had to guess, I'd guess they use floating point.

I do know that financial modelling software I worked on that was sold
to banks used floating point. Also, spreadsheets use floating point.

But it's possible (likely even) that some bookkeeping applications use
BCD. One that I worked on actually used exact, multi-precision
rational arithmetic, but I think that's unusual.

Note that the x86/x87 still supports BCD arithmetic in microcode. In
reality, though, programs that use BCD to keep track of money don't do
all that much arithmetic, so software emulation is plenty fast enough.

Robin Becker

unread,
Sep 21, 2002, 4:50:10 AM9/21/02
to
In article <7xwupf5...@ruckus.brouhaha.com>, Paul Rubin <phr-
n20...@NOSPAMnightsong.com> writes
Well I also worked in finance/research and I agree with Paul and
Christopher. Most trading/research software uses FP, most transactions
are computed using BCD.

The thing about most real financial instruments is that they use fairly
complicated sets of rules to calculate the actual interest and since the
rules evolved before modern computers are mostly computable using
fingers and counting. In particular almost all the calculations have to
be with pre-specified precision and rounding rules.

EG a bond pays fixed amounts of money at pre-specified intervals, no
calculations are involved at all. Of course when I want to compute the
yield or npv I need to do some arithmetic and FP is usually easiest and
faster as well.

Anyhow it seems to me that BCD is pretty good only for additive type
calculations. I can't see that BCD is any better than FP at representing
1/3 unless we go fully rational, but that's another story.
--
Robin Becker

Christopher Browne

unread,
Sep 21, 2002, 9:40:34 AM9/21/02
to
A long time ago, in a galaxy far, far away, Paul Rubin <phr-n...@NOSPAMnightsong.com> wrote:
> Christopher Browne <cbbr...@acm.org> writes:
>> REALITY CHECK for a moment.
>>
>> What do you think A Real Live bank uses to compute interest?
>
> If I had to guess, I'd guess they use floating point.
>
> I do know that financial modelling software I worked on that was
> sold to banks used floating point. Also, spreadsheets use floating
> point.
>
> But it's possible (likely even) that some bookkeeping applications
> use BCD. One that I worked on actually used exact, multi-precision
> rational arithmetic, but I think that's unusual.

Ask yourself:

Q: When did banks start automating their operations?

(A: Roughly the 1960s.)

Q: What were the major language choices at that time?

(A: COBOL, FORTRAN, PL/1)

Q: Did they use FORTRAN for all their applications?

(A: No, that's for the science people. Who would do financial apps in
FORTRAN?.)

Q: What sorts of programmers were they looking for to do
Y2K remediation work about three years ago, in great
hordes?

(A: COBOL, PL/1)

Q: Might these questions suggest any reason to expect that they might
have been using languages where money, which is their raison
d'etre, might have been expressed in BCD?

Can you suggest languages that would be widely used in an MVS
environment that WOULDN'T include BCD arithmetic?

I would expect that even C for S/390 would include a BCD arithmetic
language extension, because BCD gets used /everywhere/ on MVS-based
systems, and that is the classic OS platform of banking.
--
(concatenate 'string "aa454" "@freenet.carleton.ca")
http://cbbrowne.com/info/advocacy.html
"Not only do I strongly recommend against using PC NFS, but I'm
willing to bet you won't find anyone willing to code a free PC NFS
client. I bet even Richard Stallman would charge for a PC NFS
client." -- Steve Conley <sco...@regents.state.oh.us>

Dennis Lee Bieber

unread,
Sep 21, 2002, 2:32:16 PM9/21/02
to
Paul Rubin fed this fish to the penguins on Friday 20 September 2002
10:34 pm:


>
> I do know that financial modelling software I worked on that was sold
> to banks used floating point. Also, spreadsheets use floating point.
>

There's probably a subtle distinction between "modelling" (to me that
implies something that approximates expected behavior for rapid "what
if" scenarios) and accounting type applications.



> But it's possible (likely even) that some bookkeeping applications use
> BCD. One that I worked on actually used exact, multi-precision
> rational arithmetic, but I think that's unusual.
>

If it is done in COBOL that's pretty much a given... Though most COBOL
compilers /have/ added things like "usage is computation" -- wherein
the programmer explicitly has to request a binary value rather than
normal BCD.

Though I must be mis-interpreting the book I have -- it implies that
the default for Fujitsu Cobol v4 is "Display" (8-bit characters), and
one would have to ask for "packed-decimal" in a usage clause. COMP for
floating point, and BINARY for integer.

--
> ============================================================== <
> wlf...@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulf...@dm.net | Bestiaria Support Staff <
> ============================================================== <
> Bestiaria Home Page: http://www.beastie.dm.net/ <
> Home Page: http://www.dm.net/~wulfraed/ <

Christian Tismer

unread,
Sep 21, 2002, 11:10:09 PM9/21/02
to
Dan Bishop wrote:
> Magnus Lyckå <mag...@thinkware.se> wrote in message
news:<3D8B1537...@thinkware.se>...
>
>>ChrisBarker wrote:
>>
>>>The only reason I can see
>>>to not writing your class in Python is performance, and unless you are
>>>doing a lot of calculations, that is probably a non-issue.
>>
>>Performance issues might well matter in large financial
>>systems, but that's not the only reason.
>
>
> Please name one other real-world situation in which decimal arithmetic
> is actually *needed*.

There is no reason to argue about that.
Decimal arithmetic is exact for most of the operations
bankers require. They have been demanding for it since
decades, and they will not drop it. Having "no rounding
issue at all" is better than any consideration about
neglectible errors, it cannot be beaten, since *they*
understand it.
Cannot be discussed. They pay the bill.

Tim Peters

unread,
Sep 22, 2002, 2:45:34 PM9/22/02
to
[Christian Tismer]

> There is no reason to argue about that.
> Decimal arithmetic is exact for most of the operations
> bankers require. They have been demanding for it since
> decades, and they will not drop it. Having "no rounding
> issue at all" is better than any consideration about
> neglectible errors, it cannot be beaten, since *they*
> understand it.
> Cannot be discussed. They pay the bill.

Bless you, Christian! That's all the truth. It reminds me of my first job
in this business, where after a few months my boss took me aside and
reminded me that I was hired to be a prostitute, not a missionary <wink>.

otoh-the-bankers-need-stackless-but-just-don't-know-it-yet-ly y'rs - tim


Dennis Lee Bieber

unread,
Sep 22, 2002, 4:58:07 PM9/22/02
to
ChrisBarker fed this fish to the penguins on Wednesday 18 September
2002 10:01 am:


>
> just like VB.
>
Just located one of my references (O'Reilly: VB & VBA).

Based upon the description, VB /currency/ data type is a 64-bit
(binary) integer with implicit scaling for FOUR decimal places -- so
one STILL has to be concerned with rounding to get to whole cents.

The other "applicable" data type is /decimal/, which appears to be a
28-digit packed BCD format. (Though where VB stores the sign and
decimal point info I don't know -- book says the type takes 14-bytes).

Alex Martelli

unread,
Sep 23, 2002, 3:54:30 AM9/23/02
to
Robin Becker wrote:
...

> rules evolved before modern computers are mostly computable using
> fingers and counting. In particular almost all the calculations have to
> be with pre-specified precision and rounding rules.

Right.

> EG a bond pays fixed amounts of money at pre-specified intervals, no
> calculations are involved at all. Of course when I want to compute the
> yield or npv I need to do some arithmetic and FP is usually easiest and
> faster as well.

Wrong! At least, if you have to follow legally mandated procedures
to post the yield, etc -- and at least in the EU there are quite a
few cases where you do. For example, whenever you offer something
for sale to the public on any kind of instalment-payment plan, you
have to publish TWO different values for the interest rate that the
buyer ends up paying, exactly because there are subtly different
ways to compute such things and the legislators wanted to make VERY
certain that no seller tries to skew the computation and thereby
misinform buyers. The two ways of computing interest use the
acronyms TAEG and TAEV in Italy -- I'm not sure what they refer to,
exactly: in practice, everybody looks at the higher one of the two
before entering into any financially substantial transaction (and/or
for a LARGE discrepancy between them, to take as an indication that
there is something fishy about the whole deal -- but fractions of a
percent of difference are quite typical, and the numbers are posted
with specified accuracy of two decimal digits, e.g. "TAEG 10.23%").

I don't think there's any degree of freedom about how you can perform
these calculations -- the whole purpose of the legislation seems to
be exactly to ensure that sellers do NOT get any freedom to choose
what numbers to display in order to mislead buyers in any way. In
particular, I think rounding procedures are strictly specified (but
I don't know the exact details).


> Anyhow it seems to me that BCD is pretty good only for additive type
> calculations. I can't see that BCD is any better than FP at representing
> 1/3 unless we go fully rational, but that's another story.

Yes, but I don't see legal specifications to use such fractions; rather,
I see specifications such as "18.75% of the sum" -- always a finite
number of decimal digits. Your quoted paragraph at the start may
explain why -- things must in principle be computable with "fingers
and counting"... and, of course, "pre-specified precision and
rounding rules", which are never expressed in terms compatible with
binary floating-point hardware... always in terms of somebody
conducting a decimal computation with finite numbers of digits.


Alex

Stuart D. Gathman

unread,
Sep 23, 2002, 5:16:10 PM9/23/02
to
On Sat, 21 Sep 2002 23:10:09 -0400, Christian Tismer wrote:

> Dan Bishop wrote:

> > Please name one other real-world situation in which decimal
> > arithmetic is actually *needed*.
>
> There is no reason to argue about that. Decimal arithmetic is exact for
> most of the operations bankers require. They have been demanding for it
> since decades, and they will not drop it.

Let me add a horror story of what happens when financial
applications do *not* demand fixed point/decimal arithmetic.

We took on a client whose accounting system used binary floats for all
dollar amounts. And I mean *dollar* amounts, not penney amounts. Since
all pennies were approximate, the total due at the bottom of the invoices
would rarely match what the customer would get adding up the line items
on a calculator. It was only off by a few cents, but it tended to make
customers lose faith in the system. Statements also did not add up, and
the Balance Sheet didn't balance.

We converted their system to use fixed point, and now everything balances
and totals to the penney. Unfortunately, their CPA keeps his own version
of their General Ledger on Excel with binary floating point. The CPA
balance sheets do not balance. The CPA General Journal transactions do
not balance. I demonstrated with a calculator that the CPA figures did
not balance, but they insisted that we had to go with the CPA figures
because he is a CPA, and I'm just a programmer.
This is tricky since their new General ledger does not accept unbalanced
transactions.

My solution was to create a 'CPA adjustment' account to contain
all the discrepancies, and manually decide how to allocate the
extra/missing pennies for the CPA transactions.

There ought to be severe penalties for idiots that use floating point
dollars for financial applications. If forced to use floating point
(e.g. because customer demands BASIC), then keep money amounts in
whole pennies (or whatever the smallest currency unit for the country
is), and divide by 100 (or whatever) for printing only (or just add the
decimal point yourself).

--
Stuart D. Gathman <stu...@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - Mozart background
song for the Microsoft "Where do you want to go from here?" commercial.

Christian Tismer

unread,
Sep 23, 2002, 5:53:59 PM9/23/02
to
Tim Peters wrote:
> [Christian Tismer]

[you cannot discuss it since they want it]

> Bless you, Christian! That's all the truth. It reminds me of my first job
> in this business, where after a few months my boss took me aside and
> reminded me that I was hired to be a prostitute, not a missionary <wink>.

Hee hee, yes we are prostitutes. Well, Open Source is a way
out. But when you want people to pay you for it, it slips in, again.

> otoh-the-bankers-need-stackless-but-just-don't-know-it-yet-ly y'rs - tim

I'll let them know, teling them that Stackless is pure decimal.

Steve Holden

unread,
Sep 25, 2002, 7:35:05 AM9/25/02
to
"Stuart D. Gathman" <stu...@bmsi.com> wrote in ...

> On Sat, 21 Sep 2002 23:10:09 -0400, Christian Tismer wrote:
>
> > Dan Bishop wrote:
>
> > > Please name one other real-world situation in which decimal
> > > arithmetic is actually *needed*.
> >
> > There is no reason to argue about that. Decimal arithmetic is exact for
> > most of the operations bankers require. They have been demanding for it
> > since decades, and they will not drop it.
>
Strangely enough, my experience has been somewhat different. You can perform
the arithmetic by mixing chickens' blood with short sticks if you want, the
thing that interests the financial guys is *correct answers*.

> Let me add a horror story of what happens when financial
> applications do *not* demand fixed point/decimal arithmetic.
>
> We took on a client whose accounting system used binary floats for all
> dollar amounts. And I mean *dollar* amounts, not penney amounts. Since
> all pennies were approximate, the total due at the bottom of the invoices
> would rarely match what the customer would get adding up the line items
> on a calculator. It was only off by a few cents, but it tended to make
> customers lose faith in the system. Statements also did not add up, and
> the Balance Sheet didn't balance.
>

In point of fact it is perfectly possible to use floating-point for such
purposes. The important thing is not to allow rounding errors to accumulate,
which effectively means rounding to 2DP or whatever is required for each
figure that will be presented as part of any total.

> We converted their system to use fixed point, and now everything balances
> and totals to the penney. Unfortunately, their CPA keeps his own version
> of their General Ledger on Excel with binary floating point. The CPA
> balance sheets do not balance. The CPA General Journal transactions do
> not balance. I demonstrated with a calculator that the CPA figures did
> not balance, but they insisted that we had to go with the CPA figures
> because he is a CPA, and I'm just a programmer.
> This is tricky since their new General ledger does not accept unbalanced
> transactions.
>

Although Excel will use binary floating point, the problem is precisely its
failure to round the figures it's presenting, which *will* allow rounding
errors to creep in. Excel has a calculation option to use "precision as
displayed", shich will help a lot. Unfortunately you are pissing in the wind
trying to get a CPA to admit there may be things they don't understand about
arithmetic. Make sure that if you *can* get him(?) to try this option he
uses a copy iof his spreadsheet, since it will change the precision of
constants permanently.

> My solution was to create a 'CPA adjustment' account to contain
> all the discrepancies, and manually decide how to allocate the
> extra/missing pennies for the CPA transactions.
>

I remember having to explain why it was never going to be possible to
reconcile a multi-currency sales ledger when daily rate changes meant that a
payment arrived having a different value than it had when it set off. At the
same time the accountant educated me as to why columns of figures such as
invoices really must "add up".

I discovered the funniest thing when a few years later I worked with a bunch
of five CPAs to build a combined sales/purchase/general ledger with
integrated job costing, job pricing and payroll. Obviously we had several
interesting discussions about what signs should have which meaning in every
possible context. I discovered that even experienced accountants frequently
use soem rule relating back to the physical circumstances of their training,
like "debits go in the column nearest the window". So they don't actually
think all the time in abstract concepts.

> There ought to be severe penalties for idiots that use floating point
> dollars for financial applications. If forced to use floating point
> (e.g. because customer demands BASIC), then keep money amounts in
> whole pennies (or whatever the smallest currency unit for the country
> is), and divide by 100 (or whatever) for printing only (or just add the
> decimal point yourself).
>

I disagree. The penalties should be reserved for those who undertake this
kind of work without understanding what they are getting into. The methods
used must satisfy the customer, but the customer isn't usually bothered how
the results are achieved. In my particular case everything was done in BASIC
Plus, so any kind of decimal computation was right out. Floats
(appropriately rounded at every step) were perfectly acceptable.

regards
-----------------------------------------------------------------------
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
Previous .sig file retired to www.homeforoldsigs.com
-----------------------------------------------------------------------

Tim Hoffman

unread,
Sep 25, 2002, 9:30:11 AM9/25/02
to

>
> There ought to be severe penalties for idiots that use floating point
> dollars for financial applications. If forced to use floating point
> (e.g. because customer demands BASIC), then keep money amounts in
> whole pennies (or whatever the smallest currency unit for the country
> is), and divide by 100 (or whatever) for printing only (or just add the
> decimal point yourself).
>

In many circumstances this is exactly what you can't do.
The minute you need to calculate percentages you will get in to
the things like .0001254 of a cent, no matter what is you
smallest unit of currency.

I worked for a insurance company (using Business Basic) many
years ago on MAI and Prime gear, and we did everything as floats
with 14 places after the decimal point,and only rounded when
a human needed to see a number, and then used standard accounting
practices for rounding,

Rgds

Tim

Dan Bishop

unread,
Sep 25, 2002, 4:15:20 PM9/25/02
to
"Stuart D. Gathman" <stu...@bmsi.com> wrote in message news:<amo0aq$5nf$1...@nntp2-cm.news.eni.net>...
>...

> There ought to be severe penalties for idiots that use floating point
> dollars for financial applications. If forced to use floating point
> (e.g. because customer demands BASIC), then keep money amounts in
> whole pennies (or whatever the smallest currency unit for the country
> is), and divide by 100 (or whatever) for printing only (or just add the
> decimal point yourself).

That's exactly how things were done at my old workplace, except that
cents were also used for user input. Most of the time.

Alessandro Riolo

unread,
Sep 26, 2002, 9:15:36 AM9/26/02
to

Alex Martelli wrote:
> The two ways of computing interest use the acronyms TAEG
> and _TAEV_ in Italy -- I'm not sure what they refer to, exactly:

They are TAEG ("Tasso annuo effettivo globale") and TAN ("Tasso annuo
nominale"); I never heard of TAEV.
The TAN is ever lower than the TAEG, 'cause the TAN is just the
yearly nominal interest rate, it is useful only to compare it with the
national infation rate or similar general purpose index, while the
TAEG
is a rate calculated following a specific law, and in TAEG are
comprised also the effective costs (all of the most hidden ones as
commissions and insurances), and it is the rate we have to use to
compare different loans.
When there is a large discrepance betweeen TAN and TAEG, I would not
entrust that so much, and even when the TAN is higher than the TAEG I
would be really worried (it would mean the bank is paying money to me
to open a loan ..).

p.s.: Alex, I'm really having funny time with Python ;-)

--
ale
www.sen.it


Christos TZOTZIOY

unread,
Jan 4, 2003, 2:29:59 PM1/4/03
to
On Sun, 22 Sep 2002 14:45:34 -0400, rumours say that Tim Peters
<tim...@comcast.net> might have written:

>where after a few months my boss took me aside and
>reminded me that I was hired to be a prostitute, not a missionary <wink>

Quite incredible[1]. Same thing, same words (but in Greek) were used by
my boss then in a similar discussion early '91 (I would presume that the
discussion with your boss happened earlier and you never mentioned it
before 1991, so my boss never got to read them somehow. Or there might
be an older common reference...).

I remember I found the selection of words quite appropriate for me then
to help me land in the real world...

[1] or maybe not. Although the coincidence of words is amusing
(actually, he used the somewhat more harsh italian (very widespread in
my country too, sono certo che Alex lo sa :) word for 'whore', not for
'prostitute'), I now find easy to believe that the concept of doing this
comparison must be quite common in the software industry.
--
TZOTZIOY, I speak England very best,
Real email address: 'dHpvdEBzaWwtdGVjLmdy\n'.decode('base64')

0 new messages