[Prophesy] C from Python Example

Daniel Phillips phillips at bonn-fries.net
Wed Jun 12 03:22:25 EST 2002


On Tuesday 11 June 2002 18:47, Rasmus Andersen wrote:
> On Tue, Jun 11, 2002 at 05:17:08PM +0200, Daniel Phillips wrote:
> > On Tuesday 11 June 2002 09:31, Rasmus Andersen wrote:
> > > While I am at it, I might as well give the incantations:
> > > 
> > > % swig -python transform.i
> > > % cc -I/usr/include/python2.2 -shared -o foo.so transform.c transform_wrap.c
> > > 
> > > The tutorial at the www.swig.org site is fairly short and concise.
> > 
> > Yes, it is.  There's one incantation missing: how do you import your foo.so
> > module into python?  So far I don't know how to go about loading a module
> > that's in my current working directory.
> 
> As I tried to say, that is one problem I haven't had: On a variety
> of platforms I have been able to load from working directory.

Is Debian one of those platforms?  If not, then I suppose it's just
a configuration issue, specifically, the initialization of sys.path:

  http://www.python.org/doc/current/ref/import.html

Could you please do:

  import sys
  sys.path

and see if "." is one of the entries?  The first entry I see here is '',
which seems a little odd.

-- 
Daniel



More information about the Prophesy mailing list