regutil.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:purelove 作者: hucmosin 项目源码 文件源码
def RegisterModule(modName, modPath):
    """Register an explicit module in the registry.  This forces the Python import
           mechanism to locate this module directly, without a sys.path search.  Thus
           a registered module need not appear in sys.path at all.

       modName -- The name of the module, as used by import.
       modPath -- The full path and file name of the module.
    """
    try:
        import os
        os.stat(modPath)
    except os.error:
        print "Warning: Registering non-existant module %s" % modPath
    win32api.RegSetValue(GetRootKey(), 
                         BuildDefaultPythonKey() + "\\Modules\\%s" % modName,
        win32con.REG_SZ, modPath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号