On 12/28/2023 12:20 AM EST rbowman via Python-list <[1]python-list@python.org> wrote: On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote: The biggest caveat is that the shared variable MUST exist before it can be examined or used (not surprising). There are a few other questions. Let's say config.py contains a variable like 'font' that is a user set preference or a calibration value calculated by A to keep with the thread title. Assuming both scripts are running, how does the change get propagated to B after it is set in A and written to the shared file? Is there a mechanism to allow both scripts to make updates? The easy way out is to assume the changes will be picked up when the scripts are restarted but this is not always acceptable. -- [2]https://mail.python.org/mailman/listinfo/python-list If one module does a: import config config.font = "New Value" Then every other module in that program that also did a import config will see the new value of that variable, as the assignment rebound the name in the module namespace to the new value. Note, it does NOT work if you did a from config import font font = "New Value" as that doesn't change the binding in the config module. IF you need to propagate to a different process, you need something different. References Visible links 1. mailto:python-list@python.org 2. https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: How/where to store calibration values - written by program A, read by program B
Richard Damon via Python-list Thu, 28 Dec 2023 07:53:27 -0800
- Re: How/where to store calibration values ... DL Neil via Python-list
- Re: How/where to store calibration va... DL Neil via Python-list
- Re: How/where to store calibratio... Chris Green via Python-list
- Re: How/where to store calibration values ... Chris Green via Python-list
- How/where to store calibration values - wr... Greg Walters via Python-list
- Re: How/where to store calibration va... rbowman via Python-list
- Re: How/where to store calibratio... Peter J. Holzer via Python-list
- Re: How/where to store calibr... Grant Edwards via Python-list
- Re: How/where to store ca... Peter J. Holzer via Python-list
- Re: How/where to sto... Chris Green via Python-list
- Re: How/where to store calibratio... Richard Damon via Python-list
- Re: How/where to store calibration values ... Greg Walters via Python-list