ImportError while importing winreg module of python

前端 未结 2 1551
挽巷
挽巷 2021-01-07 08:22

I wanted to use winreg module of python for working with windows registry. But when I try to import winreg module, it gives ImportError.

Python 2.4.3 (#1, De         


        
相关标签:
2条回答
  • 2021-01-07 08:42

    It looks like you're trying to import a windows only module on a *nix platform (RedHat is not Windows).

    _winreg – Windows registry access

    Platforms: Windows

    0 讨论(0)
  • 2021-01-07 08:45

    It can't work on Linux.

    _winreg - Windows registry access

    Availability: Windows.

    New in version 2.0. These functions expose the Windows registry API to Python. Instead of using an integer as the registry handle, a handle object is used to ensure that the handles are closed correctly, even if the programmer neglects to explicitly close them.

    This module exposes a very low-level interface to the Windows registry; it is expected that in the future a new winreg module will be created offering a higher-level interface to the registry API.

    source: http://docs.python.org/release/2.1.2/lib/module--winreg.html

    0 讨论(0)
提交回复
热议问题