Fix unclosed files in pyscripts (#635)

diff --git a/examples/python/wasm_tvm_mnist_payload/test_lib.py b/examples/python/wasm_tvm_mnist_payload/test_lib.py
index 5ff3df5..5586e5b 100755
--- a/examples/python/wasm_tvm_mnist_payload/test_lib.py
+++ b/examples/python/wasm_tvm_mnist_payload/test_lib.py
@@ -30,10 +30,11 @@
 print(loaded_lib)
 
 dev = tvm.runtime.cpu()
-module = graph_executor.create(open(json_path).read(), loaded_lib, dev)
+with open(json_path) as jsonfile, open(param_path, "rb") as paramfile:
+    module = graph_executor.create(jsonfile.read(), loaded_lib, dev)
 
-loaded_param = bytearray(open(param_path, "rb").read())
-module.load_params(loaded_param)
+    loaded_param = bytearray(paramfile.read())
+    module.load_params(loaded_param)
 
 # Resize it to 28X28
 resized_image = Image.open(img_path).resize((28, 28))
diff --git a/services/access_control/python/acs_engine_test.py b/services/access_control/python/acs_engine_test.py
index bf7774e..27aef6a 100644
--- a/services/access_control/python/acs_engine_test.py
+++ b/services/access_control/python/acs_engine_test.py
@@ -21,8 +21,9 @@
     from acs_engine import *
 
     model_path = os.path.join(os.path.dirname(__file__), '../model.conf')
-    test_model = open(model_path).read()
-    acs_setup_model(test_model)
+    with open(model_path) as modelfile:
+        test_model = modelfile.read()
+        acs_setup_model(test_model)
 
     FUSION_TASK               = "data_fusion"
     FUSION_TASK_PARTY_1       = "usr_party1"