From 1924d829dd09984e5840b0054e43bd6c41af4e62 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 22 May 2014 10:04:43 +0200 Subject: [PATCH] draft for converting --- program/hypconvert/hypconvert.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/program/hypconvert/hypconvert.py b/program/hypconvert/hypconvert.py index 04b5eda..7aa7cd0 100644 --- a/program/hypconvert/hypconvert.py +++ b/program/hypconvert/hypconvert.py @@ -5,12 +5,14 @@ import json import ast import re -with open('../output/raw_out.txt', 'r') as data: - d = data.readline() - d = re.sub('\)\]}$', '}', - re.sub('\)\],', ',', - re.sub('\[Field\(\'.*?\', ', '', d))) - print d - d = ast.literal_eval(d) +def main(): + with open('../output/raw_out.txt', 'r') as data: + d = data.readline() + d = re.sub('\)\]}$', '}', + re.sub('\)\],', ',', + re.sub('\[Field\(\'.*?\', ', '', d))) + d = ast.literal_eval(d) + pprint.pprint(d) -pprint.pprint(d) +if __name__ == '__main__': + main() -- 2.20.1