On Thu, Aug 21, 2008 at 4:34 PM, James <[EMAIL PROTECTED]> wrote: > I have a program that I am writing that will be shared amongst > multiple users. This program sits in the background as a daemon and > 'does' things (consider it a black box). I want users to be able to > SSH into the Linux box that is running the code and then do something > like this: > > $ program.py addMe <username> <var2> > > In other words, a user will 'pass' something (an argument, for a lack > of better words) into the program that is *already* running, and the > program will modify its behavior based on that command.
One possibility is for the daemon to be listening on some kind of socket. A web server is one example; in that case the users could load a web page to change the behaviour. Another simple way to do this would be for the daemon to be an xml-rpc server; your addMe program would make an rpc call to the server. This is easy to do with the Python standard library. For example see http://blog.doughellmann.com/2008/06/pymotw-simplexmlrpcserver.html http://blog.doughellmann.com/2008/07/pymotw-xmlrpclib.html Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
