On Sat, Dec 26, 2015 at 8:14 AM, <ariklapid.s...@gmail.com> wrote: > As you can see, I want the program to print all values each 5 seconds. > When I run the file "main.py" it does print values every 5 seconds, BUT when > I manually change > the values (e.g. airTemperture = 30 instead of 24) and save the file, nothing > changes - > the old values keep on printing.
Changing the source code of a module isn't going to affect that module in a running program if it's already been imported. You can use the importlib.reload function to force a module to be reloaded, but this is generally anti-recommended. If not done correctly it can result in multiple versions of the module being simultaneously in use, leading to confusing error conditions. It sounds like you're not trying to update the code anyway, just the data used in the code. For that, you'd be better off putting the data in a data file that your "sensors.py" would read from and re-read on every iteration. -- https://mail.python.org/mailman/listinfo/python-list