简体   繁体   中英

Simplest, easiest way for 2 Python scripts on 2 computers over local network to share data

Computer A: Has a script which, when run, will return the content of a iMessage sent to the computer (from the Messages.app)

Computer B: Has a script which will display the content of the iMessage received on Computer A

This is the desired result. Currently the way I have it working is all on one machine, so the computer that receives the message is able to display it. I have tried running the script on Computer B with the script pointing to the path of the message file from Computer A via Mac file sharing. The problem with this is the file sharing seems very intermittent, it often disconnects or doesn't grab the up to date information. When it's all running on one machine, it's instant, no delays.

What alternatives are there for transferring the data between the 2 computers. Can Computer B trigger Computer A to run the script that gets the data, and then somehow have it sent to the script on Computer B?

Thanks for any help!

If it's not clear, let me know and I'll try to elaborate more

I suggest you look into the 'pika' module and RabbitMQ message broker. More info on their tutorial page. https://www.rabbitmq.com/tutorials/tutorial-one-python.html

A free and simple RabbitMQ server can be found here: https://www.cloudamqp.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM