[Edu-sig] Advice: is python suitable?

Kirby Urner urnerk at qwest.net
Thu Oct 7 20:28:30 CEST 2004

Hi Peter --

I looked the 3006b.pdf.  I don't think enough specifications are provided
regarding what is meant by a "scientific language" before negative judgments
are passed on Java and the scripting languages.  I don't immediately trust
that the authors know what they're talking about.

Like this paragraph:

    Scripting languages such as Tcl, Perl and Python are not in 
    themselves scientific languages but can be used to tie together 
    code in other languages and provide user interfaces.

Way too dismissive.  Especially in light of their earlier spec (one of the
few offered):  "It is the overall time for writing, debugging and running
that is important."  Exactly, and a scripting language may save you a lot of
time in the writing and debugging steps.  The runtime speed gains you'd get
from doing the same work in C (or assembler) may be of little consequence in
a typical setting.

Scientific calculations based on real data or constants are usually fine
with IEEE 754 floating point ( http://grouper.ieee.org/groups/754/ ).
Material such as the following, about the peculiarities of binary-based
arithmetic, may belong in any introduction -- I see 3006b.pdf discusses some
of these same topics:  http://docs.python.org/tut/node15.html

Anyway, Python is entirely suitable for doing physics computations.  There's
also add-on called Numeric that will provide more of the linear algebra and
FFT if you need it (I notice the Forest Basic programs come with a library
procedure for eigenvalues -- Numeric would be the counterpart).

The Forest Basic programs also have some graph-making library.  Python is
not welded to any one graphics technology, because there are so many,
although Tk is included in the standard distro, and so has out-of-the-box
capability (I like Zelle's wrapper for Tkinter in this connection).  

My approach to graphing, for example, has been rather unconventional:  I've
pressed a free 3D rendering package into service, using Python to write the
scene (e.g. http://www.4dsolutions.net/ocn/catenary.html ).  The more
ordinary approach would involve using Python bindings to gnuplot
(http://www.gnuplot.info/ ) for example. (
http://gnuplot-py.sourceforge.net/ )

Python has already made many inroads in the scientific community.  You
should draw your own conclusions through study, but at least have peace of
mind at the outset that you're not barking up the wrong tree.

Check out VPython as well -- a simple 3D graphics library developed at
Carnegie Mellon for use in their physics curriculum (of course it has other
applications as well).


> -----Original Message-----
> From: edu-sig-bounces at python.org [mailto:edu-sig-bounces at python.org] On
> Behalf Of Peter Bowyer
> Sent: Thursday, October 07, 2004 12:57 AM
> To: edu-sig at python.org
> Subject: [Edu-sig] Advice: is python suitable?
> Hello list,
> This is semi off-topic, so I'd better introduce myself :-)
> I'm studying physics at the University of Southampton, and joined this
> list
> as I hope to use my final year project to create physics simulations in
> Python to aid students, or (even better) write course material to teach
> the
> students how to think about the physics concepts (and program at the same
> time...).  That is still a year away, and I've not experimented much with
> Python yet to see how feasible it would be to do this kind of thing.
> This year I'm taking a course in computational physics, which allows the
> use of any programming language.  The notes however are skewed towards the
> department's in-house languages (variations on BASIC and C).  I'm hoping
> one of you could look at the course notes and tell me if there's anything
> here that is not possible to do in Python?  They are at
> http://www.phys.soton.ac.uk/teach/year3/notes/ph314/notes/phys3006b.pdf
> for
> the BASIC version, and
> http://www.phys.soton.ac.uk/teach/year3/notes/ph314/notes/phys3006c.pdf
> for
> the C version.
> Thanks,
> Peter
> --
> Maple Design - quality web design and programming
> http://www.mapledesign.co.uk

More information about the Edu-sig mailing list