I have a python file generated by swig (no experience with this). It contains this at the top:
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
and contains class definitions. Is it possible to generate C# classes from this to represent the ‘data structure’, which has to be hydrated from some proprietary database?
At the end of the day I have to talk to Python from C#. I am currently doing this by writing python files and then invoking Python from C#.
Any feedback would be very much appreciated. Thanks.
SWIG is for wrapping C or C++ so it can interface with other languages? e.g. you might use swig to wrap some C so you can call it from python or C# – but not to wrap some C# so you can call it from python (or vice-versa).
Potentially ironpython could be useful in this instance?
sounds to me what your doing already is the right solution, i.e. invoking python from C#. SWIG is irrelevant as you don’t have any C code to wrap.
some links that may be helpful are:
Call Python from .NET
Build Python scripts and call methods from C#
Calling python code(.py files) from C#