How to create and interactive, distributable program?

Alex Martelli aleax at aleax.it
Mon Nov 11 08:49:44 EST 2002


Kenneth Gomez wrote:

> Hello all,
> 
> In my course, I am asked to develop a basic finite element analysis
  [ snipped: some fundamental FEA specs ]
> To do all of this, my questions are , can Python handle the
> mathematics, e.g. does Python have a subroutine to inverse a matrix,
> or find the modulus of a number,....? Or, is it like C, where I have
> to write the subroutine myself?

Python is a good language for numerically-intensive programming
*IF* accompanied by the indispensable Numeric extension package
(and possibly further add-ons to Numeric).  So, basically just
like in C, you won't have to code any of this fundmentals by
yourself, but neither will you find them embedded in the language
itself -- rather, you'll freely download and install suitable
libraries.  For Python and numeric maths, the choice is quite
clear.  Besides Numeric, I think you'll also want to get SciPy,
from www.scipy.org, for many other useful tools.


> Second, will I be able to create the GUI explained above within 3
> months?

Yes, I think that 3 months for the GUI is a reasonable task -- if
you mean for the GUI *plus* the functioning engine behind it, with
just one person working on it and starting from zero knowledge of
Python, I think that's quite aggressive but not entirely impossible
(I'd deem it as utterly impossible with any other languages -- most
powerful languages take three months just to LEARN properly).

I think it might help to get the best cross-platform GUI engine
around, i.e., Qt -- specifically, I'd suggest theKompany's
"BlackAdder" Python IDE with PyQt, GUI-designer, etc.  However,
Qt and BlackAdder are commercial products, so if in addition
to all other constraints you ALSO want to perform this feat with
all-free tools, you'll have to use something else and save the
money (e.g. about $50 for BlackAdder personal edition in its
current beta state).


> Third, can I make the GUI into an executable file so that I can run it
> off the laptop/workstation that will be used for the presentation?

It's no doubt easier to install the application in its native
form (install Python, then Qt, Numeric, etc, then the app proper),
but if you want it badly enough, you CAN also bundle everything
up into an executable file (at least for Windows and Linux -- I
don't think other platforms are currently supported).  Two tools
that can help are py2exe (Windows-only) and McMilla's installer
(Windows and Linux).

However, it IS one more task to cram into those hugely-dense
three months -- I hope you don't mind working long hours...:-).


> Thanking you in advance for your advise.

If I were in your shoes, with an extremely aggressive schedule
and a LOT of things to be done within that schedule, I'd choose
the best tools (Python, Numeric, SciPy, Qt, BlackAdder), give
up on ALL the non-absolutely-essential parts (the tidbit about
bundling everything up into an executable file just for a
presentation seems non-essential to me, for example), and try
to stick to Extreme Programming principles as much as feasible
(e.g., the 40-hours-per-week principle does NOT seem feasible
under the given constraints and goals -- nor is pair programming
going to be, if you'll be working alone).  Working in short
iterations and boiling deliverables down to specs (expressed
as automated, executable, repeatable tests) and executable code
gives you your best chance to have something usable (though not
probably yet complete) within your deadline.


Alex




More information about the Python-list mailing list