Merge pull request #3562 from PySimpleGUI/Dev-latest
Changed so that Linux version works the same as Windows
This commit is contained in:
commit
91f1f5bac4
|
@ -251,10 +251,14 @@ def run(app_name, parm=''):
|
||||||
|
|
||||||
|
|
||||||
def run_py(pyfile, parms=None):
|
def run_py(pyfile, parms=None):
|
||||||
if parms is not None:
|
if sys.platform == 'linux':
|
||||||
execute_command_subprocess('python', pyfile, parms)
|
cmd = 'python3'
|
||||||
else:
|
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):
|
def execute_command_subprocess(command, *args, wait=False):
|
||||||
|
@ -262,7 +266,7 @@ def execute_command_subprocess(command, *args, wait=False):
|
||||||
arg_string = ''
|
arg_string = ''
|
||||||
for arg in args:
|
for arg in args:
|
||||||
arg_string += ' ' + str(arg)
|
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:
|
else:
|
||||||
expanded_args = ' '.join(args)
|
expanded_args = ' '.join(args)
|
||||||
sp = subprocess.Popen([command, expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
sp = subprocess.Popen([command, expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in New Issue