flowy/printhdf.py
2010-11-05 18:57:01 +01:00

21 lines
No EOL
530 B
Python
Executable file

#!/usr/bin/python
from optparse import OptionParser
import pytables
import record
import sys
def printHDF(hdf_file):
r = pytables.FlowRecordsTable(hdf_file)
recordReader = record.RecordReader(r)
for rec in recordReader:
print rec
if __name__ == "__main__":
usage = 'usage: %prog file_name.h5'
p = OptionParser(usage)
options, arguments = p.parse_args()
if len(arguments) != 1:
sys.stderr.write('Exactly one argument expected\n')
exit(1)
printHDF(arguments[0])