h5py读取fi时忽略外部链接

2024-04-29 07:08:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在从一个hdf5文件中读取组,其中一些组成员是外部链接。我希望能够确定哪些组成员是外部链接,然后忽略它们以便进一步阅读。在

示例代码:

f = h5py.File(filename, 'r')
data = f['header']
for p in date.keys:
    (if p is an external link, detect it here!)

Tags: 文件代码in示例fordatadateif
1条回答
网友
1楼 · 发布于 2024-04-29 07:08:23

工作代码:

f = h5py.File(filename, 'r')
data = f['header']
for p in date.keys:
    if bool('h5py._hl_.group.ExternalLink' in str(type(data.get(p, getlink=True))))):
        print 'External link found!'

漂亮的Python,我知道。。。;)

相关问题 更多 >