logo       

Re: newbie: loading' example' example in python: msg#00115

programming.swig

Subject: Re: newbie: loading' example' example in python

On Thu, 23 Jan 2003 17:55:17 -0800
Harry Mangalam <hjm@xxxxxxxxx> wrote:

> OK - with the help of my betters (thanks to Diane Trout), I've been able
> to get
> the C module to load, but the solution is not like anything the recent
> docs
> indicate.
>
> You have to name the generated .so '_example.so' and in Python:
>
> >>>import _example
>
> No other combination of names, underscores, etc worked. If this is in
> fact the
> case, it might be worth correcting the docs for this. However, it seems
> odd
> that this convention is actually the intended one (...?)

That is only if you want to import the shared lib directly. SWIG assumes that
you will access the wrapper through the generated python code. You should see an
example.py where you compiled the extention. This is what gets imported if you
do an 'import example', and in example.py you will see 'import _example'.


Nic
--
Nicholas Henke
Linux Cluster Systems Programmer
Liniac Project - Univ. of Pennsylvania
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise