next up previous contents
Next: Writing a simple HDF5 Up: Python Interface - PyHL Previous: node

Examples

The creation of HDF5 files with PyHL is quite easy, and there are not to many things one has to know about the HDF5 internals. However, in order to build an HDF5 file, one has to understand that the file should be built sequentialy, i.e. it is not possible to create a subgroup to a group before the group has been created. Neither is it possible to create an attribute or a dataset in a group before the group has been created etc. In other words, always create the top nodes before trying to create nodes under them in the heirarchy.

Another thing to bear in mind is that when the method addNode has been called the nodelist instance will take control over the node, so it will not be possible to alter the node after a call to addNode has been made.

When working with compound types, remember that the data that is passed to setScalarValue and setArrayValue must be a Python string. Also when working with compound types, the itemSize and lhid has to be passed on, otherwise the compound data most likely will be corrupted.

Also when working with compound types, be aware that the hdf5 library has to be linked dynamically, otherwise it will not be possible to pass the hid_t references between the Python modules.

Time to look at some simple examples. Comments will be written in italics and the actual code will be written in bold face.



 
next up previous contents
Next: Writing a simple HDF5 Up: Python Interface - PyHL Previous: node

2000-08-08