I have file named config.py
, content like below:
logindata = [
{'user': '18320967034', 'password': '123456'}
]
I wanna modify the logindata and write it back,
import config
config.logindata[0]['password'] = 'xxxx'
How can I write it back to config.py
?
Please don't tell me to use .ini/configparser