From 956aaf8ad683c85fc723e73c54674c8108207c92 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Tue, 1 Oct 2019 12:34:38 +0100 Subject: use ast module to evaluate items read from boundary definition file. --- makeBoundary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'makeBoundary.py') diff --git a/makeBoundary.py b/makeBoundary.py index 1fc6b69..21b1113 100755 --- a/makeBoundary.py +++ b/makeBoundary.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import numpy as np import bisect +import ast def read_definition(filename): ddict = {} @@ -10,7 +11,7 @@ def read_definition(filename): for line in f: items = line.split(': ', 1) if len(items) == 2: - ddict[items[0]] = eval(items[1]) + ddict[items[0]] = ast.literal_eval(items[1]) return ddict # read boundary definition file. -- cgit