From ee0ae1a2e7e23889116d84a4b9055055104ef873 Mon Sep 17 00:00:00 2001 From: Chetouane <elias.chetouane@univ-grenoble-alpes.fr> Date: Fri, 1 Dec 2023 16:36:26 +0100 Subject: [PATCH] =?UTF-8?q?Remplacement=20de=20l'appel=20syst=C3=A8me=20pa?= =?UTF-8?q?r=20un=20appel=20=C3=A0=20subrocess=20(plus=20stable=20et=20plu?= =?UTF-8?q?s=20d'options)=20->=20=C3=A0=20tester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run-all-codes.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/run-all-codes.py b/run-all-codes.py index 43211c1..04fc75a 100644 --- a/run-all-codes.py +++ b/run-all-codes.py @@ -1,6 +1,4 @@ - - -import os +import subprocess """ v2 @@ -13,7 +11,7 @@ def execute_python_file(file_path): excute a py program from a file_path """ try : - os.system(f'python {file_path}') + subprocess.run(['python', file_path]) except FileNotFoundError: print(f"Error: The file '{file_path}' does not exist.") -- GitLab