Re: [Pythonmac-SIG] Correct way to send info to running program
Bob wrote: > NSDistributedNotificationCenter? > > You didn't really specify what your requirements are... > I'm trying to set up a "simplest thing that could possibly work" for getting events from another application which doesn't really play well with others. I have hacked it enough that it logs the events I want to the console, so I can, for example, put a tail -f console.log | grep [events I'm interested in] | sendMessageToMyApp. I was intending to make "sendMessageToMyApp" be based on datagrams using something along the lines of: import socket host, port = 'localhost', 8081 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.sendto('some data from the command-line', (host, port)) But I was thinking that I could use NSPort to receive these messages, which was totally off base. I can apparently use CFSocket, but realized that I should do a reality check and see if there's a better way than the somewhat convoluted and roundabout path I'd set up. It looks like NSDistributedNotificationCenter might work. I'll try it out. Thanks! --Dethe ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Correct way to send info to running program
On May 27, 2005, at 11:04 PM, Dethe Elza wrote: > I want to be able to periodically send data to a running program, > from the command-line. I was looking at the various NSPort classes, > but just discovered that NSSocketPort is not a raw socket, but only > intended to talk to other NSPort instances. Surely I'm not the only > one who wants to be able to do this. Is there a "one right way?" NSDistributedNotificationCenter? You didn't really specify what your requirements are... -bob ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Correct way to send info to running program
I want to be able to periodically send data to a running program, from the command-line. I was looking at the various NSPort classes, but just discovered that NSSocketPort is not a raw socket, but only intended to talk to other NSPort instances. Surely I'm not the only one who wants to be able to do this. Is there a "one right way?" Any guidance here would be appreciated. --Dethe There are only two industries that call their customers "users" ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig