Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to write python function based on below requirement, the libraray is limited to regex and os only , Below is the attribute they only

How to write python function based on below requirement, the libraray is limited to regex and os only ,

image
Below is the attribute they only allow us to use
image

book_folder_path (A relative folder path, i.e., "/data/books_data/") book_info_path (A relative path, i.e., "/data/result_data/books.txt") book_title_list (List of all books titles such as "[title1, title2, title3, ...]") book_info_dict (Key-value pairs of a book title and book object such as "{title1: obj1, title2:obj2, title3:obj3.......}") 2.2.1. extract_book_info() Extracts book attributes from each book contained within a folder (i.e., book_folder_path)and writes these as a formatted string (See 2.1.2.__str__()) in a given file (i.e., book_info_path). Positional Arguments Returns N/A A boolean result should be returned to indicate the success of the method, i.e., True if completed, False if an error has occurred. Notes: If this method is called multiple times, you need to make sure the result book file does not contain duplicates. Every time this method is called, the book_title_list and book_info_dict should also be updated if any changes are found. 2.2.2. load_book_info() Loads all the book's information from a given file (i.e., book_info_path) into the book_info_dict dictionary and the book_title_list list. Positional Arguments N/A Returns A boolean result should be returned to indicate the success of the method, i.e., True if completed, False if an error has occurred. Notes: Some book titles may have more than one line of text, which needs to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Foundations of Financial Management

Authors: Stanley Block, Geoffrey Hirt, Bartley Danielsen, Doug Short, Michael Perretta

10th Canadian edition

1259261018, 1259261015, 978-1259024979

More Books

Students also viewed these Programming questions

Question

Indicate how such a quota sample might be achieved.

Answered: 1 week ago

Question

Exude confidence, not arrogance.

Answered: 1 week ago