简体   繁体   中英

Recommendations for communication between Python scripts

I want to write a few python3 scripts that can retrieve almost instantly some variables (less than 400 integers in total) shared by one another.

  • One script shares specific variable. Many scripts can read this variable.
  • Script can update value up to 50 times per second and share up to 50 variables.
  • Bus should allow at least 10k R/W operations per second.
  • Bus can be managed by master process
  • Hardware: ARM based board with modern Debian OS and 1GiB of RAM.
  • KISS and lightweight

Some scripts are reading data from sensors and sharing their values. Some are logging values, other is processing data and sets its variables according to target motor speed.

I recommend one of the following solutions:

  • shared memory (have a look at python multiprocessing values/arrays)
  • an HTTP server via TCP/IP or a local os socket

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