how to set environment variable in windows for python 3.8 code example
Example 1: python path to python executable
>>> import sys
>>> print(sys.executable)
C:\path\to\python.exe
Example 2: edit path variable using python
app_path = os.path.join(root_path, 'other', 'dir', 'to', 'app')
os.environ["PATH"] += os.pathsep + app_path