"Learning Python" is a very good book that can help you deal with simple
python data types... ;)
print x[1]['uid']
jens
On Wednesday, July 17, 2002, at 09:10 , Klaus Boehm wrote:
> can anyone tell me how i can obtain the value from an attributetype(uid)
>
> from a user profile in ldap?
>
> this is my code:
>
> import ldap
> l = ldap.initialize("ldap://ldap.dmg.ewt.de:389")
>
> l.simple_bind_s("cn=admin, o=xxx", "xxxxxx")
> x = l.search_s("ou=People, o=xxx", ldap.SCOPE_ONELEVEL, "gecos=xxxxxx",
> attrlist=['uid'], attrsonly=0)
> print x
> or
> print x[0]
>
> ('cn=klausboehm, ou=People, o=xxx', {'uid': ['value']})
>
> the output is a list with one index.
> how can i extract the value from the attribute uid?
>
>
> thanks for help
>
> klaus
>
> --
>
> ewt gmbh
> data management group
> tel: ++49 821 3106 319
> fax: ++49 821 3106 399
> url: www.ewt.de
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Python-LDAP-dev mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
|