From 8b80b17baac9aabbb46d025bf125b81b00f173c8 Mon Sep 17 00:00:00 2001 From: waldek Date: Tue, 9 Nov 2021 17:04:26 +0100 Subject: [PATCH] before csv --- learning_python3.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/learning_python3.md b/learning_python3.md index 0274464..42be00b 100644 --- a/learning_python3.md +++ b/learning_python3.md @@ -1815,7 +1815,16 @@ if __name__ == "__main__": ``` -## csv, JSON and yaml +# Text based databases + +The todo list example from before is handy but quite *limited* as a database. +As is it only holds one form or information and that is the *actual task*. +What if we want to add urgency or mark tasks complete (instead of deleting)? +This can be done by grouping data together. +We already saw a dictionaries which are good mapping structures but how can we save them to disk? +A hacky way would be to write a python file containing the `dict` and `import` it when we need it. +But there are better ways. + # Now for some useful scripting @@ -1823,6 +1832,7 @@ With everything we have learned up until now you can start doing some interestin Have a look at [these exercises](https://gitea.86thumbs.net/waldek/linux_course_doc/src/branch/master/modules/qualifying/exercise_python.md). You can try them out at your own pace. I can give some hints or pointers if needed, either in class or individually. +Don't hesitate to ask for help! # Creating our own classes