[Pyrex] help with structs and arrays

Tom Jenkins tjenkins at devis.com
Fri Oct 1 15:25:02 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Greg,
|    cdef enum:
|      MAXSTRING = 120
|      MAXPARTCLASSES = 500

This took care of the integer & array problem.  And I figured out the
other 3 problems.


| genpsdpage.pyx:46:25: Obtaining char * from temporary Python value
| genpsdpage.pyx:56:23: Cannot convert 'float (*)' to Python object
| genpsdpage.pyx:61:23: Cannot convert 'float (*)' to Python object
|

float frac[MAXPARTCLASSES+1]
float dval[MAXPARTCLASSES+1]
<snip>
self.dval = []
for i in range(params.dval):
<snip>

well first this was a typo (i meant range(len(...))).  after more
searching i changed it to:
for i from 0 <= i <= params.numdiams:
~   curr_dval = params.dval[i]
<snip>

this works since numdiams is the length of both arrays.  i therefore
didn't need to use len().

the obtaining char * message i found with google and eliminated it with
a simple assignment to a local variable.

- --
Tom Jenkins
devIS - Development Infostructure
http://www.devis.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0-nr2 (Windows XP)
Comment: Using GnuPG with MultiZilla - http://enigmail.mozdev.org

iD8DBQFBXVquV7Yk9/McDYURAhF4AKDH1+hT9DLjtW6KJV2PLovwrCdOWgCg0oQe
xEamvQCx80H2QRIpo6j1M1M=
=UNvi
-----END PGP SIGNATURE-----




More information about the Pyrex mailing list