[PYTHON MATRIX-SIG] "linking" variables to python

Leo Caves caves@yorvic.york.ac.uk
Fri, 2 Aug 1996 18:53:51 +0100


Hi!

context:
extending python with a legacy FORTRAN app.
and have used the  PyArray_FromDimsAndData() function to
link FORTRAN common block arrays to python array objects.
is working beautifully...

Q: how to do the same with scalar variables ?
eg.
INTEGER N in FORTRAN declaration
to python object (say) n

I am trying to avoid acessing as array of length 1.

Also, I would like to ask what the current opinions on
the perennial array indexing question are.
i.e. indexed from 0 (in python) vs. 1 in FORTRAN.
My point here is that I have a whole load of integer arrays in
FORTRAN which serve as indices into other arrays.  Therefore these
would have to be remapped to point to the correct place in the
python array.

Thanks,
Leo Caves

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================