Share a dict with multiple Python scripts

后端 未结 8 1157
予麋鹿
予麋鹿 2020-12-14 11:31

I\'d like a unique dict (key/value) database to be accessible from multiple Python scripts running at the same time.

If script1.py updates

8条回答
  •  自闭症患者
    2020-12-14 12:07

    You could use a document-based database manager. Maybe is too heavy for your system to do so, but concurrent access is typically one of the reasons DB management systems and API to connect to them are in place.

    I have used MongoDB with Python and it works fine. The Python API documentation is quite good and each document (element of the database) is a dictionary that can be loaded to python as such.

提交回复
热议问题