- Open the object that you wish to add an attribute to.
- Create the attribute
- Write to the attribute
- Close the attribute and the object it is attached to.
The example below creates attributes that are attached to the dataset
The dataspace, datatype, and data are specified in the call to create an attribute in Python: