I've created a python script that reads from a config.py
file using import config
to inform it's output.
config.py
:
current_brightness = 0
script.py
:
import config
set_brightness(config.current_brightness + 1)
I need current_brightness
to be permanently incremented in config.py
after running the script, so that subsequent script runs will import the newly updated value instead of it always being 0.
In other words, how do I write to a config.py
file like I would any other standard config format like config.ini
?