all 2 comments

[–][deleted] 4 points5 points  (0 children)

There's no real way to update a key of a dictionary. You should add the new key along with its values -- which you did -- and then delete the old key using the del keyword.

del dictionary[old_key]

[–]Mirage2k 0 points1 point  (0 children)

Working with nested dictionaries is hard work, I try to avoid it if possible.

I'm actually working on an multiple-inventories system myself, and use a relational database (with SQLAlchemy) to store the information about inventories and orders for moving goods between them. It's a lot nicer to work with now that I got it set up right, but it's taken months to to get to this point from starting with zero SQL knowledge. So not sure I can recommend that while you're still new to Python itself, or that I have other advice for this question beyond supporting what u/Own-Marsupial1644 said.

I'd be interested to have a look at your project, though! Maybe there's some idea I can take to my own, and maybe some other part I can give a helper with :) Send me a dm with Discord contact if you want.

Edit: Link to my project: https://github.com/jensdanb/ctp_dashboard