Daemon process which accepts arguments and returns results
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.
精彩评论