I don't think you can figure it out using standard Python, for example os.environ. The only way to get user and system variables in Windows is to use the registry, you can find more here :
HKEY_CURRENT_USER\Environment
System variables
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
User variables
You need to access the registry with Python in order to get them.
source
share