I've got a python script that loops indefinitely waiting for input, and then does something when the input happens. My problem is then making python tell emacs to do something. I just need some way to send emacs input and make emacs evaluate that input.
Here's some code to illustrate my problem...
while(1):
on_off = query_lightswitch
if on_off == 0:
send_text_to_emacs("(setq 'lightswitch t)")
Ideally I'd send emacs a string that it evaluates in its elisp interpreter. I've tried pymacs, but it looks like pymacs is made to start stuff from emacs rather than python. When I try something like this in pymacs it locks up until the loop terminates. This looks like a problem I could solve with unix pipelines, if I knew enough. If anybody out there has any ideas on how to solve this problem I'd be much obliged, thanks.