From: <mi...@nc...> - 2009-03-26 22:02:30
|
Sorry, I misunderstood the meaning of the docs and got a bit of tunnel vision on that point. Thanks for persisting and straightening me out. When attempting to do an import, I get: C:\Program Files\Adobe\Copy of fdk7.2>python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import example Traceback (most recent call last): File "<stdin>", line 1, in <module> File "example.py", line 28, in <module> import _example ImportError: No module named _example The docs show this to be a common error, but I've convoluted my makefile every which way I could think of to resolve, but cannot. ---- Josh Cherry <jc...@nc...> wrote: > "Dynamic loading into Python" refers to loading with import. You can call > fact() through ctypes without using SWIG. > > Josh > > > On Thu, 26 Mar 2009, mi...@nc... wrote: > > >> From the SWIG tutorial: > > > > "Running SWIG under Microsoft Windows SWIG also works perfectly well > > under all known 32 bit versions of Windows including 95/98/NT/2000/XP. > > SWIG is typically invoked from the command prompt and can be used with > > NMAKE. Modules are typically compiled in the form of a DLL that can be > > dynamically loaded into Tcl, Python, or whatever language you are using. > > With a little work, SWIG can also be used as a custom build option > > within MS Developer Studio." > > > > ---- Josh Cherry <jc...@nc...> wrote: > >> Then unless I'm missing something, using SWIG is pointless. When you call > >> fact() that way you're calling the original fact(), not the SWIG-generated > >> wrapper function. > >> > >> Josh > >> > >> > >> On Thu, 26 Mar 2009, mi...@nc... wrote: > >> > >>> I'm compiling it into a dll using microsoft's command-line compiler, not > >>> gcc, so I'm using ctypes to access the dll. > >>> > >>> ---- Haoyu Bai <div...@gm...> wrote: > >>>> I'm a bit confused. SWIG is not relay on ctypes. This should work: > >>>> > >>>> import example > >>>> example.fact(5) > >>>> > >>>> -- Haoyu Bai > >>> > >>> > >>> ------------------------------------------------------------------------------ > >>> _______________________________________________ > >>> Swig-user mailing list > >>> Swi...@li... > >>> https://lists.sourceforge.net/lists/listinfo/swig-user > >>> > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > Swig-user mailing list > > Swi...@li... > > https://lists.sourceforge.net/lists/listinfo/swig-user > > |