My question is how to create a simple database in python. My example is:
User = {
'Name' : {'Firstname', 'Lastname'},
'Address' : {'Street','Zip','State'},
'CreditCard' : {'CCtype','CCnumber'},
}
Now I can update this User’s information just fine, but how do I
- Add more users to this data structure. A dictionary of dictionaries?
- Allow users to have more than one credit card, a many to one relationship
Thanks for any responses, I’ve been trying to wrap my head around this for awhile
You might be interested in SQLAlchemy. It makes an actual database, such as SQLite or MySQL, work more like Python classes.