Skip to content Skip to sidebar Skip to footer

Python's Platform Module Does Not Detect Windows 10

I am working on Windows 10 presently and need to put some code if the platform is Windows 10. So, I checked in python docs and read about platform module. This is what the document

Solution 1:

The problem is python uses GetVersionEx to determine the version.

As you can read here, Microsoft doesn't support this anymore and offers a different API.

However, you can always call the new API yourself, or check the registry value at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion.

You can also use WMI to get the Win32_OperatingSystem instance.

I'd also like to note that specific version checking is generally considered a bad practice.


Post a Comment for "Python's Platform Module Does Not Detect Windows 10"