Merge pull request #3562 from PySimpleGUI/Dev-latest

Changed so that Linux version works the same as Windows
This commit is contained in:
PySimpleGUI 2020-10-30 18:18:46 -04:00 committed by GitHub
commit 91f1f5bac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -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)