Can I store a file (HDF5 file) in another

2019-07-25 10:49发布

I have a HDF5 file and a list of objects that I need to store for saving functionality. For simplicity I want to create only one save file. Can I store H5 file, in my save file that I create with serialization (pickle) without opening H5 file.

1条回答
Rolldiameter
2楼-- · 2019-07-25 11:35

You can put several files in one by using zipfile or tarfile

  • for zipfile you would write the database files and writestr your pickle.dumpsed data.
  • for tarfile you would add the database file and gettarinfo, addfile your pickle.dumped data from a file.

I would suggest creating a zip if you do not need extended filesystem-attributes because it is a bit easier to use.

查看更多
登录 后发表回答