From 977bc6619699b96ea008e48eaf631cf9e8e2c6aa Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 30 Oct 2020 18:18:26 -0400 Subject: [PATCH] Changed so that Linux version works the same as Windows --- DemoPrograms/Demo_GitHub_File_Copier.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/DemoPrograms/Demo_GitHub_File_Copier.py b/DemoPrograms/Demo_GitHub_File_Copier.py index 7627c541..1a4be6ba 100644 --- a/DemoPrograms/Demo_GitHub_File_Copier.py +++ b/DemoPrograms/Demo_GitHub_File_Copier.py @@ -251,10 +251,14 @@ def run(app_name, parm=''): def run_py(pyfile, parms=None): - if parms is not None: - execute_command_subprocess('python', pyfile, parms) + if sys.platform == 'linux': + cmd = 'python3' else: - execute_command_subprocess('python', pyfile) + cmd = 'python' + if parms is not None: + execute_command_subprocess(cmd, pyfile, parms) + else: + execute_command_subprocess(cmd, pyfile) def execute_command_subprocess(command, *args, wait=False): @@ -262,7 +266,7 @@ def execute_command_subprocess(command, *args, wait=False): arg_string = '' for arg in args: arg_string += ' ' + str(arg) - sp = subprocess.Popen(['python3' + arg_string, ], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + sp = subprocess.Popen([command + arg_string, ], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: expanded_args = ' '.join(args) sp = subprocess.Popen([command, expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)