Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shared object in C# to be used in python script

I have created a windows app which runs a python script. I'm able to capture the output of the script in textbox. Now i need to pass a shared object to python script as an argument from my app. what type of shared object should i create so that python script can accept it and run it or in simple words how do i create shared object which can be used by python script.

thanks

like image 599
sia Avatar asked Aug 07 '26 09:08

sia


2 Answers

Since python is running as another process. This is no way for python to access object in c# directly since process isolation.

A way of marshal and un-marshal should be included to communicate between processes.

There are many way to communicate between processes. Share memory, file, TCP and so on.

like image 119
comphilip Avatar answered Aug 08 '26 21:08

comphilip


5.4. Extending Embedded Python will help you to access the application object. In this case both application and python running in single process.

like image 33
tijo Avatar answered Aug 08 '26 23:08

tijo