First page Back Continue Last page Overview Graphics

Creating and Using the Module foo

swig -c++ -python foo_list.i

g++ -fPIC -c foo_list.cpp foo_list_wrap.cxx -I/usr/include/python3.4

g++ -shared foo_list.o foo_list_wrap.o -o _Foo.so

Using Foo in Python3:

>>> import Foo

>>> Foo.bar()

[2.0, 4.0]

>>> type(Foo.bar())

<class 'list'>

>>>