I am quite new not only to pydicom but also dicom in general. I was attempting to save multiple non-standard metadata instances to multiple data elements in a dicom-file within a for-loop. Therefore I tried the following:
block = ds.private_block(0x000b, "My company 001", create=True)
for i, md in enumerate(md_dict):
block.add_new(print(hex(i)), "SH", md_dict(md))
where md_dict is a python dictionary of Metadata instances that I want to add. This was not working (error that NoneType (print(hex(i)) can not be compared to integer) and I am rather certain that this not the way to approach it. The problem was that I don't know how to set the tag element numbers within a loop.
But it did not quite help.
Hope somebody can steer me in the right direction.
Thanks in advance for your efforts.