This is much easier than you might think.
check out: http://fsckd.com/2009/4/25/simple-python-ctypes-example
and http://docs.python.org/library/ctypes.html#module-ctypes