About my problem:
I create instances of a class several times, each time my frontend sends a message to my backend.(This can't be changed either).
Now the instances have to fulfill the following:
- The dictionary must not be lost each time the instance is created.
- The instances have different dictionaries.
Do you know how I can realize this?
Until now I have this in my class:
class ScheduleOptimizeNew:
data = {
"Station": {
}}
def __init__(self, cfgpath):
self.cfg = cfgpath
and here its get created in my app.py:
scheduleroptimizernew= ScheduleOptimizeNew(CFGPath)
Thank you very much!
Here's some code so you can understand Class Variables vs Instance Variables:
Class Variables
Output:
Instance Variables
Output