小受被抬起腿狠狠贯穿_欲望保姆_yantasy https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/ Teach, learn and make with 小雪第一次交换又粗又大老杨 Pi Sun, 19 Sep 2021 15:46:26 +0000 hourly 1 https://wordpress.org/?v=6.9.4 https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1513490 Sun, 21 Jul 2019 14:41:53 +0000 https://www.yantasy.org/?p=52439#comment-1513490

would pickle or json work better than csv for storing the data?

]]>
https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1513456 Sun, 21 Jul 2019 03:49:39 +0000 https://www.yantasy.org/?p=52439#comment-1513456

In reply to Steve Williams.

Create
Read
Update
Delete

]]>
https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1512886 Mon, 15 Jul 2019 06:31:14 +0000 https://www.yantasy.org/?p=52439#comment-1512886

In reply to lou.

which author’s book is best for python ?

]]>
https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1512625 Wed, 10 Jul 2019 02:18:06 +0000 https://www.yantasy.org/?p=52439#comment-1512625 Great read! Wish I had cool little projects like this when I was in school.

I added a few things:
at the top:
with open(filename, ‘a’): pass
#to create the file if it doesn’t exist.

current_ID = data[-1].get(“ID”)
#[:-1] – slicing returns a list which doesn’t have the get method, [-1] returns the item at the end of a list.

search_term = str(input(“What would you like to search for?”)).lower()
and
if search_term in str(val).lower():
#if you try to search by id or year, you’re gonna get a error cus ints don’t have the .lower() method.

]]>
https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1512615 Tue, 09 Jul 2019 19:29:59 +0000 https://www.yantasy.org/?p=52439#comment-1512615 WHen developing database applications I find it pays to remember the acronym CRUD – Create, Report, Update, Delete.
One should be able to:
– create new records – if you don’t, then how do you get data into the database application;
– report on the records – if you don’t then why are you storing them;
– update records – if you don’t the data will go out of date (things change!);
– delete records – otherwise the database application’s storage will grow and grow!

]]>
https://www.yantasy.org/blog/how-to-build-databases-using-python-and-text-files-hello-world-9/#comment-1512607 Tue, 09 Jul 2019 17:31:12 +0000 https://www.yantasy.org/?p=52439#comment-1512607 ISBN is not a good key for a library database. Problems:

– Not all books printed today *have* an ISBN (if they have been privately printed)
– *No* book printed before 1965 has an ISBN
– An ISBN is unique to an edition of a book – libraries (including personal libraries) often have duplicates.

I can’t think of any more problems, but I’m sure there are some. (It’s always a good idea to make people aware of how messy real world data is.)

]]>