+ added generice parser code
[qpalma.git] / ParaParser / simple_example.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import sys
5 from ParaParser import *
6
7 def run(file):
8 parser = ParaParser("%d%s%s%d%d",["field0","field1","field2","field3","field4"],5)
9 parser.parseFile(file)
10 entry1_dict = parser.fetchEntry(101)
11 print entry1_dict
12 entry2_dict = parser.fetchEntry(102)
13 print entry2_dict
14
15 if __name__ == '__main__':
16 run('test.data')