469,934 Members | 2,667 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Trouble importing module using swig and python

I am beginner in python.
I am working through the tutorial examples from http://www.swig.org/ and
have run into some problems. I took the following command instructions from
the tutorial on swig.org:


I have written example.c and example.i as described in the above tutorial.
My first attempt at compiling the libraries was this:
$ swig -python example.i

it should produce example.py and example_wrap.c files . But i am not getting
example.py file in the folder where i am executing swig -python example.i

But with example_wrap.c file i can able to produce _example.so shared object
gcc -c example.c example_wrap.c \

gcc -shared example.o example_wrap.o -o _example.so

and doing

ld -shared example.o example_wrap.o -o _example.so

and when iam trying to import from python like

import example

it is saying no module named example.

My first Question is that should i get example.py in folder and second
Question is that if it is not neccessary then where i am going wrong ??
Please help me in this regard.


View this message in context: http://www.nabble.com/Trouble-import...p19930052.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Oct 11 '08 #1
0 1132

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by David Eger | last post: by
7 posts views Thread by Carl Waldbieser | last post: by
2 posts views Thread by Rick Olson | last post: by
reply views Thread by Brandon Metcalf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.