Requirement:
Invoke Python script (on server) via C#, e.g. via webapi. Here restful endpoint receives parameter (e.g. via GET request) and results from Python execution is returned (e.g. as JSON).
I am aware of this:
How do I run a Python script from C#?
I have used this approach in the past. For data exchange I used:
- C# writes data to file system (e.g. from GET request's query strings)
- C# invokes Python, which picks up data from file system and writes results to file system
- C# reads data from file system and returns (e.g. as JSON)
Just wondering are there neater ways to integrate 'pure' Python these days?