0

I've written a code in python that opens and reads a file that is saved as an .hdf5 format. If I don't have an hdf viewer installed on my computer can this code still run?

I'm not using it to open the file so I can look at it, I'm trying read the file & extract data before manipulating it in python. Probably a silly question but I'm very new to this coding thing. Would my code be unable to open a file type that can not be opened on my computer?

Cheers, Claire

Claire H
  • 3
  • 2
  • A said below, you really need the library to decode the binary file. It is free though, and, as said below, comes with many tools. So I suggest you get it... Note also the Python interface "h5py". Finally, if you have Matlab you probably can read it with Matlab as you would read any *.mat file, because that is what Matlab always does. – Tom de Geus Jan 25 '18 at 14:59

3 Answers3

0

An hdf5 viewer is a program that knows how to interpret the contents of an hdf5 file — much like the program you are trying to write. So your program would at least need to include code (most likely in the form of a module) that knows how to do that.

Scott Hunter
  • 48,888
  • 12
  • 60
  • 101
0

I'm not very familiar with hdf5. But I think you couldn't manipulate it directly if the file is binary since it's not human readable and you could use something like viewer to "decode" those binary data.

According to this though, I think the answer is you don't have to have the hdf5 viewer to run your code.

ZYYYY
  • 81
  • 4
0

So the python code has h5py but the code itself does not need the computer I'm working on to have the hdfviewer software. It is still capable of running the code without opening the file with the hdfviewer.

Claire H
  • 3
  • 2