Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from ctypes import *
- lib = cdll.LoadLibrary('./libfoo.so')
- class Foo(object):
- def __init__(self):
- self.obj = lib.Foo_new()
- lib.Foo_bar.restype = c_double
- def bar(self, a, b, c, d):
- return lib.Foo_bar(self.obj, c_double(a), c_double(b), c_double(c), c_double(d))
- f = Foo()
- a = 1
- b = 2.5
- c = 3.5
- d = 3.5
- print f.bar(a, b, c, d)
Add Comment
Please, Sign In to add comment