0

My main application is a .NET desktop application which relies on some calls to python script for AI. I'd like to know if there are some guidelines/recommandations toward how to best have my python code able to use functions from my .net app. Shall I pass functions or shall I have python code also using python.net to callback some functions?

One example of such pattern would be logging. I am using Serilog and I would like to reuse my .NET configuration for Python. Another example would be a function to read some proprietary content where the code exists in .net not in python.

I am currently using Python.NET successfully to call Python functions from my .NET application.

Thank you!

Amaury Levé
  • 1,459
  • 10
  • 21

1 Answers1

0

I don't think there is a magic bullet for you. Essentially, you are right: if one wants to share logging and other infrastructure they would need to write adapters for one or another language depending on preference.

It would probably be a good idea (for the community) to share those adapters as an open source projects.

LOST
  • 2,956
  • 3
  • 25
  • 40
  • Thanks! I know there is no silver bullet, that's why I am asking for recommandations. I would like to avoid exploring tons of options that people would have already explored. Before going for a big communication layer between the 2 stacks, I'd like to start with simple "tricks". For example, I don't manage to simply pass a .net method to python. – Amaury Levé May 06 '21 at 09:27