From e6ab594e149756ab820d22a6a4bfb84111d2bf8a Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 2 Nov 2021 22:11:19 +0800 Subject: [PATCH] Change shebang used in CLI demo. (#7389) Change from system Python to environment python3. For Ubuntu 20.04, only `python3` is available and there's no `python`. So at least `python3` is consistent with Python virtual env, Ubuntu and anaconda. --- demo/CLI/binary_classification/mapfeat.py | 2 +- demo/CLI/binary_classification/mknfold.py | 4 ++-- demo/CLI/regression/mapfeat.py | 2 +- demo/CLI/regression/mknfold.py | 3 ++- demo/CLI/yearpredMSD/csv2libsvm.py | 2 ++ 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/demo/CLI/binary_classification/mapfeat.py b/demo/CLI/binary_classification/mapfeat.py index 4cb98f652..1c8ac9ab3 100755 --- a/demo/CLI/binary_classification/mapfeat.py +++ b/demo/CLI/binary_classification/mapfeat.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 def loadfmap( fname ): fmap = {} diff --git a/demo/CLI/binary_classification/mknfold.py b/demo/CLI/binary_classification/mknfold.py index a941f8609..f5e237e36 100755 --- a/demo/CLI/binary_classification/mknfold.py +++ b/demo/CLI/binary_classification/mknfold.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python3 + import sys import random @@ -26,4 +27,3 @@ for l in fi: fi.close() ftr.close() fte.close() - diff --git a/demo/CLI/regression/mapfeat.py b/demo/CLI/regression/mapfeat.py index 01c7035d6..1e0318e99 100755 --- a/demo/CLI/regression/mapfeat.py +++ b/demo/CLI/regression/mapfeat.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 fo = open('machine.txt', 'w') cnt = 6 diff --git a/demo/CLI/regression/mknfold.py b/demo/CLI/regression/mknfold.py index 3a3c0f647..3e11934d8 100755 --- a/demo/CLI/regression/mknfold.py +++ b/demo/CLI/regression/mknfold.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python3 + import sys import random diff --git a/demo/CLI/yearpredMSD/csv2libsvm.py b/demo/CLI/yearpredMSD/csv2libsvm.py index 828c95495..0f763501c 100755 --- a/demo/CLI/yearpredMSD/csv2libsvm.py +++ b/demo/CLI/yearpredMSD/csv2libsvm.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys fo = open(sys.argv[2], 'w')