[Tutor] Shadow Class Generation Problem

Marcus Konermann m_konermann@gmx.de
Mon, 17 Dec 2001 03:22:12 +0100


--------------940C4D9B9E273F51B9DFD38E
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi @ All !

I generate a Python Shadow Class from an excisting c++ file using SWIG.
The compiling and linking process went ok and a simanneal.py file was
generated beginning in the following form:

# This file was created automatically by SWIG.
import simannealfilec
class simanneal_varlist:
    def __init__(self,*args):
        self.this = apply(simannealfilec.new_simanneal_varlist,args)
        self.thisown = 1

And after using this simanneal.py by importing it the following error
occurs:

Traceback (most recent call last):
  File "C:\Python2_1_1\Pythonwin\pywin\framework\scriptutils.py", line
396, in ImportFile
    reload(sys.modules[modName])
  File "C:\Optimierer\ext1\mainko.py", line 2, in ?
    import simannealfile
  File "C:\Optimierer\AG TEM\simannealfile.py", line 2, in ?
    import simannealfilec
ImportError: No module named simannealfilec

In the SWIG manual i read that this simannealfilec was automatically
generated by SWIG and that this file isīnt visible.
Has anyone an idea to avoid this error message ?

Greetings
Marcus

--------------940C4D9B9E273F51B9DFD38E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi @ All !
<p>I generate a Python Shadow Class from an excisting c++ file using SWIG.
The compiling and linking process went ok and a simanneal.py file was generated
beginning in the following form:
<p><i># This file was created automatically by SWIG.</i>
<br><i>import simannealfilec</i>
<br><i>class simanneal_varlist:</i>
<br><i>&nbsp;&nbsp;&nbsp; def __init__(self,*args):</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.this = apply(simannealfilec.new_simanneal_varlist,args)</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.thisown = 1</i>
<p>And after using this simanneal.py by importing it the following error
occurs:
<p><i>Traceback (most recent call last):</i>
<br><i>&nbsp; File "C:\Python2_1_1\Pythonwin\pywin\framework\scriptutils.py",
line 396, in ImportFile</i>
<br><i>&nbsp;&nbsp;&nbsp; reload(sys.modules[modName])</i>
<br><i>&nbsp; File "C:\Optimierer\ext1\mainko.py", line 2, in ?</i>
<br><i>&nbsp;&nbsp;&nbsp; import simannealfile</i>
<br><i>&nbsp; File "C:\Optimierer\AG TEM\simannealfile.py", line 2, in
?</i>
<br><i>&nbsp;&nbsp;&nbsp; import simannealfilec</i>
<br><i>ImportError: No module named simannealfilec</i><i></i>
<p>In the SWIG manual i read that this simannealfilec was automatically
generated by SWIG and that this file is&acute;nt visible.
<br>Has anyone an idea to avoid this error message ?
<p>Greetings
<br>Marcus</html>

--------------940C4D9B9E273F51B9DFD38E--