![]() If (MajorVersion > 3) or ((MajorVersion = 3) With TRegistry.Create1(KEY_READ and not KEY_NOTIFY) do ![]() First try HKEY_CURRENT_USER as per PEP514 Key:= Format('\Software\Python\PythonCore\%s%s\InstallPath', If (MajorVersion > 3) or ((MajorVersion = 3) and (MinorVersion >= 5)) then Also from vers.3.5 onward 32 bit version have a suffix -32 e.g. installations the dll is located at the InstallPath. The above convention was changed in Python 3.5. Out InstallPath: string out AllUserInstall: Boolean) : Boolean So, for current user installations we need to try and find the install path since it may not be on the system path.įunction IsPythonVersionRegistered(PythonVersion : string All user installations place the Py dll in the Windows System directory and write registry info to HKEY_LOCAL_MACHINE.Ĭurrent user installations place the dll in the install path and the registry info in HKEY_CURRENT_USER version < py 3.5. Python provides for all user and current user installations. exe with foo.lib, as that would cause Windows to require the DLL to be present, we load it dynamically.įirst we check our Python installation. You can then write Python “import foo”, and Python will search for foo.pyd (as well as foo.py, foo.pyc) and if it finds it, will attempt to call PyInit_foo() to initialize it. If you have a DLL named foo.pyd, then it must have a function PyInit_foo().
0 Comments
Leave a Reply. |