From 8dd2bfcdb04750215e2154119feedb7d7af75f74 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 28 May 2021 15:29:25 -0400 Subject: [PATCH] cwd is automatically set to the folder of the application being launched when execute_py_file is called with cwd=None --- PySimpleGUI.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index fc4cb90f..7e279dcd 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.43.0.1 Unreleased\nChanged get_versions string to be more clear, removed canvas from return values" +version = __version__ = "4.43.0.2 Unreleased\nChanged get_versions string to be more clear, removed canvas from return values, cwd is automatically set to the folder of the application being launched when execute_py_file is called with cwd=None" __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -18383,7 +18383,8 @@ def execute_py_file(pyfile, parms=None, cwd=None, interpreter_command=None, wait :return: Popen object :rtype: (subprocess.Popen) | None """ - + if cwd is None: + cwd = os.path.dirname(pyfile) if pyfile[0] != '"' and ' ' in pyfile: pyfile = '"'+pyfile+'"' if interpreter_command is not None: