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.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Understanding Ceph and Its Place in the Market
- Astronomy for KDE
- Git 2.9 Released
- OpenSwitch Finds a New Home
- Maru OS Brings Debian to Your Phone
- What's Our Next Fight?
- The Giant Zero, Part 0.x
- SoftMaker FreeOffice
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide