#!/usr/bin/python from ctypes import * libraryName='./libwisdom.so' wise=CDLL(libraryName) #Not the only way to load this print "Generating a random number:",wise.getRandomNumber() print "Is 'Talking out of turn' a paddlin'? Let's find out!" print wise.check_paddlin('Talking out of turn') print "Uh... that was... different" print "Oh right! ctypes presumes an integer return type! Let's fix that!" wise.check_paddlin.restype=c_char_p print "Let's try again now..." print wise.check_paddlin('Talking out of turn') print "There we go! What about 'Paddling the school canoe'?" print wise.check_paddlin('Paddling the school canoe')