View Single Post
Old 05-29-2025, 11:55 AM   #26
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,878
Karma: 6120478
Join Date: Nov 2009
Device: many
Given Windows 10 is virtually at end of life, is there some way in python to see/detect the difference between Windows 10 and Windows 11?

Update: The dreaded Google AI gave me the following snippet:

Code:
    import platform

    def get_windows_version():
        """Detects Windows 10 vs Windows 11 based on build number."""
        if platform.system() != "Windows":
            return "Not Windows"

        version_info = platform.version()
        build_number_start_index = version_info.find('Build ') + 6
        build_number_end_index = version_info.find(' ', build_number_start_index)
        build_number = int(version_info[build_number_start_index:build_number_end_index])
        if build_number >= 22000:
            return "Windows 11"
        else:
            return "Windows 10"


    print(get_windows_version())
And if that AI found this routine someplace it should have that license. If it devised this just based on other language versions, then it should clearly state the license or say it is public domain.

Last edited by KevinH; 05-29-2025 at 12:05 PM.
KevinH is offline   Reply With Quote