1

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.

2
  • I have no access to the original C/C++. Not sure about ironpython. My understanding is that it only adds python to .net. Not sure whether it can also be used to invoke 'native' python. Commented Oct 16, 2012 at 10:47
  • Thanks. Feel free to compose an answer ... Commented Oct 16, 2012 at 11:08

1 Answer 1

1

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:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.