Mar-28-2021, 07:22 PM
Hi all,
I have 2 py files. Stock.py and data.py. I use a dictionary from the data file and would like to update it from within the stock file.
For example, the following code is in the stock file. All items in the dictionary +1.
I googled this for a while, but I can not figure it out...
Any help would be greatly appreciated!
I have 2 py files. Stock.py and data.py. I use a dictionary from the data file and would like to update it from within the stock file.
For example, the following code is in the stock file. All items in the dictionary +1.
from data import stuk for cat in stuk: stuk[cat] = stuk[cat] + 1 print(stuk)The data file contains:
stuk = {"hoeksalon":0, "fauteuils":0, "Relax zetels":0, "Salontafel":0, "bijzettafel":0, "Zetels":0, "Slaapbanken":0 }How do I update the data file?
I googled this for a while, but I can not figure it out...
Any help would be greatly appreciated!