LDAP Programming in Python
You probably are anxious now to run the program and see it in action. But first, you need to append the following code to call the main() function. It should go at the end of your script before you run it.
if __name__=='__main__': main()
Now that you have inputted everything you need to run the Python program, save the source code in your editor and name the file ldap-test.py. Give it a run and test it out. If you don't see any output, it is probably because you didn't enter a valid LDAP server and/or who and cred, or because there simply is no existing search field on the server that matches the one we're using (in this case *ryan*).
We have only gotten our feet wet with how to use Python to write LDAP applications; you can do a lot more with python-ldap. You can find more python-ldap programming examples here.
For more information, check out the python-ldap documentation. A complete list of LDAP-related RFCs also are freely available on-line. If you are looking for a good book, consider LDAP Programming, Management, and Integration by Clayton Donely and LDAP: Programming Directory-Enabled Applications With Lightweight Directory Access Protocol by Tim Howes. These books use programming languages such as C/C++, Perl and Java for their code examples, but they still can be helpful for those who wish to code LDAP applications in Python. For an open-source implementation of LDAP, visit OpenLDAP's web site. There's also a developer's mailing list.
- Readers' Choice Awards 2013
- Mars Needs Women
- RSS Feeds
- Sublime Text: One Editor to Rule Them All?
- December 2013 Issue of Linux Journal: Readers' Choice
- New Products
- IBM Will Minimize Impact of Future Disasters
- Raspberry Pi: the Perfect Home Server
- Linux Systems Administrator
- Advanced Hard Drive Caching Techniques
- why is GNOME 3 in the fifth position at 14.1 %?
2 hours 30 min ago
- Sublime Is Brilliant!
7 hours 33 min ago
7 hours 52 min ago
- Rapid[Disk,Cache] better than native ram caching?
8 hours 17 min ago
- Nothing is perfect
8 hours 31 min ago
- Mixtapes Community
14 hours 9 min ago
- KDE is one true DE
14 hours 44 min ago
- Command Line Shells (Bash, Zsh, etc.) are 2nd place
15 hours 12 min ago
17 hours 7 min ago
- yes it's Jupiter Broadcasting
18 hours 27 min ago