1 Antwort
+ 1
Connecting Python with c# is definitely possible but the big differences between .net and Python make it cumbersome to tightly couple the two together.
Since your question was tagged with flask and web forms, your software probably already talks with a web server.
Since you already have a web server and Python and c# compile and run in such different ways, I recommend wrapping both API's in HTTP. You can host the Python API's with a separate HTTP server from your .net-oriented server. In other words, if Python wants to use a c#-implemented API, just hit it over HTTP and vice versa.
In the end, you'd have a Python-oriented web server using something like Flask or Tornado. You'd also have a .net-oriented web server using something like Microsoft IIS. Each server would make its API's available as HTTP targets. If you also had a web application, it would be up to you which server hosts that content.
HTTP would add complexity with asynchronous calls and overhead around processing more HTTP requests but this separation is most-likely worth it. You could have Python code call a dll compiled from your c# code which will likely perform better than my main suggestion but with drawbacks that make it an uglier alternative.