开发者

Daemon process which accepts arguments and returns results

开发者 https://www.devze.com 2023-03-15 18:22 出处:网络
This is the scenario. Run a python script in background. Call this开发者_JAVA百科 script using perl with arguments and returns a result to stdout.

This is the scenario.

Run a python script in background. Call this开发者_JAVA百科 script using perl with arguments and returns a result to stdout.

How do I write this python script ?

Basically the question is how do I pass arguments to a running program ? Is this possible (via threads/subprocess/etc/., ) ? else how do I approach this problem ?


This might be a good usage for something like thrift. You can invoke methods of the python script which runs as a server. No need to resort to capturing stdout, you can just have the python script return a string to the caller.

0

精彩评论

暂无评论...
验证码 换一张
取 消