In my c# program, I'm running a python process. Currently I'm using a hardcoded path for the python.exe, but I want to use the windows registry to return the path to me.
I have found the python path info in the Windows registry under:
HKEY_CURRENT_USER\Software\Python\PythonCore\3.7-32\InstallPath
with some googling I found the following solution: https://stackoverflow.com/a/18234755/7183609
but when I run my code the variable key is always null
try
{
    using (RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Python\\PythonCore\\3.7-32\\InstallPath"))
    {
        if (key != null)
        {
            // do things
        }
    }
}
catch (Exception ex)
{
    // do other things
}
Am I doing something wrong, do I need to add something to make it work?
 
     
    