import example code from http://wiki.freepascal.org/Developing_Python_Modules_with_Pascal