Skip to content

Commit 2363f98

Browse files
Update Python
1 parent 0cd198a commit 2363f98

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

update_library.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@
5757
with open("data/library.json", "w") as f:
5858
json.dump(books, f, indent=2)
5959

60-
with open("data/library
60+
with open("data/library.csv", "w", newline="") as f:
61+
writer = csv.DictWriter(f, fieldnames=["Book Title", "Author", "Barcode", "Status", "User"])
62+
writer.writeheader()
63+
writer.writerows(books)
64+
65+
print("✅ Library updated successfully.")

0 commit comments

Comments
 (0)