From 375dba6071c46da4376bb0c7c174c91c5940a952 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sun, 21 Feb 2021 10:51:01 -0500 Subject: [PATCH] One more Linux change.... invoke using python3 rather than python --- DemoPrograms/Demo_Demo_Programs_Browser.py | 5 +++-- DemoPrograms/Demo_Project_File_Searcher_Launcher.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DemoPrograms/Demo_Demo_Programs_Browser.py b/DemoPrograms/Demo_Demo_Programs_Browser.py index 2bda80d0..44990b96 100644 --- a/DemoPrograms/Demo_Demo_Programs_Browser.py +++ b/DemoPrograms/Demo_Demo_Programs_Browser.py @@ -254,10 +254,11 @@ def run(app_name, parm=''): def run_py(pyfile, parms=None): + python = 'python' if sys.platform.startswith('win') else 'python3' if parms is not None: - execute_command_subprocess('python', pyfile, parms) + execute_command_subprocess(python, pyfile, parms) else: - execute_command_subprocess('python', pyfile) + execute_command_subprocess(python, pyfile) def execute_command_subprocess(command, *args, wait=False): diff --git a/DemoPrograms/Demo_Project_File_Searcher_Launcher.py b/DemoPrograms/Demo_Project_File_Searcher_Launcher.py index c8601a9f..49ce4c65 100644 --- a/DemoPrograms/Demo_Project_File_Searcher_Launcher.py +++ b/DemoPrograms/Demo_Project_File_Searcher_Launcher.py @@ -353,7 +353,7 @@ def main(): for file in values['-DEMO LIST-']: file_to_run = str(file_list_dict[file]) sg.cprint(file_to_run,text_color='white', background_color='purple') - execute_command_subprocess('python', f'{file_to_run}') + execute_command_subprocess('python' if running_windows() else 'python3', f'{file_to_run}') # run_py(file_to_run) elif event.startswith('Edit Me'): sg.cprint(f'opening using {editor_program}:')