I currently have a python file with a bunch of global variables with values. I want to change these values permanently from a separate python script. I've tried setattr and such but it doesnt seem to work. Is there a way to do this?
The short answer is: don't. It won't be worth the trouble.
It sounds like you are trying to create a configuration file and then have your application update it. You should try using ConfigParser, a built-in module that can read and write configuration files for you with limited hassle: http://docs.python.org/library/configparser.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With