From 5e7f7ceed7d409a0d466a075c46c139539379bbd Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Thu, 21 Jun 2018 16:50:14 +0900 Subject: [PATCH] use sys.executable as python interpreter name instead of hard-coded "python" This would be useful when gen_benchmark_data.py or gen_test_data.py is invoked using "python2" or "python3" but "python" refers to different version. --- gen_benchmark_data.py | 2 +- gen_test_data.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gen_benchmark_data.py b/gen_benchmark_data.py index b2cc63f..ee6cf16 100644 --- a/gen_benchmark_data.py +++ b/gen_benchmark_data.py @@ -10,7 +10,7 @@ def call( cmd ): ret = p.wait() print('') -pyexe = 'python' +pyexe = sys.executable # Generate input data call(pyexe + ' test/script/make_random_data.py 1 3 224 224 --output data/random_input_1_3_224_224.txt') diff --git a/gen_test_data.py b/gen_test_data.py index ba39bf6..c063276 100644 --- a/gen_test_data.py +++ b/gen_test_data.py @@ -1,3 +1,4 @@ +import sys import subprocess @@ -11,7 +12,7 @@ def call(cmd): print('') -pyexe = 'python' +pyexe = sys.executable # Generate input data call(