@@ -0,0 +1,687 @@
+#! /usr/bin/env python%0A# vim: set encoding=utf-8%0A%0Afrom ctypes import *%0A%0Alibtrie = cdll.LoadLibrary(%22./libtrie.so%22)%0Alibtrie.trie_lookup.restype = c_char_p%0A%0Aclass TrieException(Exception):%0A    pass%0A%0Aclass Trie(object):%0A    def __init__(self, filename):%0A        self.ptr = libtrie.trie_load(filename)%0A        if self.ptr == 0:%0A            raise TrieException(%22Failed to load library%22)%0A%0A    def lookup(self, key):%0A        res = libtrie.trie_lookup(self.ptr, c_char_p(key))%0A        if res:%0A            return %5Bs.decode('utf8') for s in str(res).split('%5Cn')%5D%0A        else:%0A            return %5B%5D%0A%0At = Trie('prijmeni.trie')%0Afor s in t.lookup('Sedl%C3%A1%C5%99'):%0A    print s%0Aprint '%25s' %25 t.lookup('blah')%0A

Add a python binding via ctypes