From: Mart Lubbers Date: Thu, 22 May 2014 08:04:43 +0000 (+0200) Subject: draft for converting X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=1924d829dd09984e5840b0054e43bd6c41af4e62;p=bsc-thesis1415.git draft for converting --- 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()