-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored environment dependent variables
- Loading branch information
1 parent
10efd94
commit 5f54ffa
Showing
14 changed files
with
91 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
environment | ||
""" | ||
|
||
import os | ||
import platform | ||
import sys | ||
|
||
|
||
on_windows_os = platform.system() == 'Windows' | ||
|
||
def get_py_executable() -> str: | ||
""" | ||
get the most likely python executable | ||
Returns: | ||
py_executable (str): | ||
the python executable used to start the current process | ||
""" | ||
py_executable = sys.executable | ||
if os.path.dirname(py_executable) in os.environ['PATH'].split(os.pathsep): | ||
py_executable = os.path.basename(py_executable) | ||
elif ' ' in py_executable: | ||
py_executable = f'"{py_executable}"' if on_windows_os else py_executable.replace(' ', '\\ ') | ||
return py_executable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.