I have a program in python which calls a C# program using subprocess. This c# program will run for hours. And a certain event has to trigger a key press in the c# program. I can PIPE this key press with the process object.
The issue is I want to store this subprocess popen object in some kind of list or database efficiently. As I could have multiple calls to this c# program. And would like to access each specific popen object at any given time and send in a input.
I would also like to call this python script from flask so that i have a web interface.
Things that I have tried so far.
1) Use psutil to send signal such as CTRL_C_EVENT. It doesnt work as expected. But this has the advantage of storing only the pid instead of the whole object. 2) Storing the whole object in mongodatabase. This fails when i try to pickle the popen object.
Please let me know if you need additional details.
Aucun commentaire:
Enregistrer un commentaire