A beginner's question

Manuel M. Garcia mail at manuelmgarcia.com
Sun Feb 16 22:36:42 EST 2003


On Sun, 16 Feb 2003 18:34:46 -0500, Madhusudan Singh
<spammers-go-here at yahoo.com> wrote:

>On Sunday 16 February 2003 16:17, Manuel M. Garcia (mail at manuelmgarcia.com)  
>held forth in comp.lang.python 
>(<ubuv4v0r6u6tmu4185upkd9qc92lo0cn20 at 4ax.com>):
>
>> On Sun, 16 Feb 2003 15:08:15 -0500, Madhusudan Singh
>> <spammers-go-here at yahoo.com> wrote:
>> (edit)
>>>        I do not have much time to invest in learning a new language that
>>>        I
>>> would probably not be using for any other purpose. Is there a tutorial th
>>>at you folks are aware of, that I could put to use in learning the
>>>relevant subset (if that means anything) of python ?
>> 
>> It is not unusual to be productive with Python during your first hours
>> while you are still learning the language.
>> 
>> If you use Fortran for scientific/numerical analysis programming,
>> another Python resource is 'Python and Scientific Computing':
>> 
>> http://www.python.org/topics/scicomp/
>> 
>> Manuel
>
>Thanks for your response. I looked over the link above, and I daresay that 
>it looks fairly impressive, but I am talking about *huge* programs with 
>thousands of lines of code, that use libraries like NAG, ARPACK, IMSL, 
>etc., that I and others have developed and validated over the years and it 
>does not seem too clever to shift languages, especially with the added 
>capabilities of F 95 and the forthcoming F2K. The number of 
>scientific/numeric libraries available for Fortran seem to dwarf those 
>available for any other language (and that includes C). Further, it is a 
>matter of habit.
>
>Just a matter of curiousity, how well does Python support threading (like 
>HPF), etc. on multiprocessor systems ?
>
>OTOH, scigraphica is a stand-alone application that (uses Numerical Python 
>and pygtk2 for scripting) renders plots. The interactive mode of operation 
>is impressive since it seems to be a near clone of Origin. However, I often 
>have lots of plots that need similar processing, and thought that scripting 
>like gnuplot might be more time-efficient. Hence my question.
>

One of the benefits of Python is that it works well with other
languages.  Many use it as 'glue' to automate interactions between
programs written in other languages.  A thread that was going on a few
days back was remarking how Python was a pleasant way to automate
testing for large C, C++, and Java programs.

That said, I have no specific knowledge of how Python interacts with
Fortran code and libraries, other than it can be done.  I did Google
on "Python Fortran" and there seem to be several active codebases to
do this.

Python is not appropriate for coding high performance threading.

Python would be more appropriate to quickly prototype computational
approaches to a problem, or script a GUI for high performance code
written in another language.  _Python and Tkinter Programming_ by John
E. Grayson describes techniques for rapidly coding GUI's of very high
quality using the Tkinter GUI toolset.  There are several GUI toolsets
for Python, and many documentation resources.

If the programming problem demands higher level constructs, then
coding in Python could offer superior performance.  Simply because it
would be infeasible to duplicate the programmer-hours that have gone
into the efficient implementation of Python's high level data
constructs.

For example, I use Python for problems that I would have used
Mathematica for in the past.  In my opinion, Python's current object
model is much easier to work with than Mathematica's.  Python is also
free, with an efficient portable C implementation, and the source is
fully available with a BSD-like license!

(There have been at least 2 public Python projects attempting to
duplicate a small subset of Mathematica's symbolic computation
abilities.  Unfortunately, they were written before Python's current
powerful object model was created.  I have ideas on how it could be
written now more clearly and efficiently, but no code and no time.
:-/  Anyway, any particular symbolic computation can be quickly coded
with Python in a ad-hoc way, I have found.)

Manuel




More information about the Python-list mailing list