3

I have a application that is written in C# and we really want to use some of the scikit-learn, numpy and scipy stuff for machine learning. Ultimately, what I'd like to do is pass a few parameters to the Python script from the C# application, have Python process it and return me a value to use in C#.

Unfortunately, the sci-kit stuff isn't compatible with IronPython so I cannot use that. I don't know what else I can do. I've thought of making a Python web service and then just calling that from the C# app, but I want to know if there are any other options.

Any help would be much appreciated.

TrialAndError
  • 1,784
  • 3
  • 20
  • 41
  • 2
    Is it possible to execute shell code from C#? That's one way you could do it. – rlms Oct 17 '13 at 17:04
  • it's definitely possible, but i don't know of any off-the-shelf implementations. however, if you can go the other way, embedding C# into python is nearly trivial. but a couple more options: xml-rpc, boost.python... – Corley Brigman Oct 17 '13 at 17:52
  • sweeneyrod I am not sure since I have to pass parameter in and get output. I have been researching all day and can't find a good answer to that. @CorleyBrigman I hadn't really thought of that way. I may look into doing that. – TrialAndError Oct 17 '13 at 19:08
  • see the python.NET library for how to import C# into python. once you do, it is almost native python - you can tab-complete in the console, transfer many data types back and forth without any special handling, etc. – Corley Brigman Oct 17 '13 at 20:11

0 Answers0