comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Python reader for IDL save files.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Python reader for IDL save files. [message #44263 is a reply to message #44262] Thu, 02 June 2005 05:37 Go to previous messageGo to previous message
Thomas Pfaff is currently offline  Thomas Pfaff
Messages: 15
Registered: April 2005
Junior Member
> 2. The only problem I have thought of is how to represent arrays of IDL
> structures in Python. The one attempt I made at this was succesful, but
> the resulting data structures (lists of lists, I think) were very slow
> to work with. Has anyone worked on this problem?

Just by analogy, what about implementing arrays as lists and structs as
dictionaries? Then the syntax would be quite similar yet not completely
identical.

# IDL - an array
# python - a list
a = [1,2,3,4]

# IDL - an array of structs
b = [{a:1, b:3},{a:3, b:4}]
# python - a list of dictionaries
b = [{"a":1, "b":3},{"a":3, "b":4}]

#IDL
c = b[0].a
#python
c = b[0]["a"]


Cheers,


Thomas
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: LIDAR .las format
Next Topic: Re: extracting values from an array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:23:25 PDT 2025

Total time taken to generate the page: 1.36066 seconds