test.py 文件源码

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

项目:remoteControlPPT 作者: htwenning 项目源码 文件源码
def _DumpObject(ob, level = 0):
    prefix = "  " * level
    print "%s%s object: %s" % (prefix, ob.Class, ob.Name)
    # Do the directory object thing
    try:
        dir_ob = ADsGetObject(ob.ADsPath, IID_IDirectoryObject)
    except pythoncom.com_error:
        dir_ob = None
    if dir_ob is not None:
        info = dir_ob.GetObjectInformation()
        print "%s RDN='%s', ObjectDN='%s'" % (prefix, info.RDN, info.ObjectDN)
        # Create a list of names to fetch
        names = ["distinguishedName"]
        attrs = dir_ob.GetObjectAttributes(names)
        for attr in attrs:
            for val, typ in attr.Values:
                print "%s Attribute '%s' = %s" % (prefix, attr.AttrName, val)

    for child in ob:
        _DumpObject(child, level+1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号