Answer the question
In order to leave comments, you need to log in
How to open another python file and overwrite the data in the dictionary?
You need to open the config.py file from the main bot.py
Then extract the data from the dictionary from the config, output and overwrite
How to open it, put it in a variable, and then overwrite it?
Answer the question
In order to leave comments, you need to log in
mlt_melt , don't mess with the bike, use the json module . You will be fine with storing structured data - as long as they can be represented as a part-whole set.
And if the connections are more complex, for example, there is a list of users and you need to store who is friends with whom, then it’s time to think about a relational database.
It is not clear what "overwrite" means.
Are you going to make a change to the source file?
If so, then this is imho not an "Orthodox" approach.
Why don't you want to store the configuration in an ini file?
If you want to dynamically import modules, read about importlib.
Describe the scenario in more detail. It is not entirely clear why you are going to change the source code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question