Answered step by step
Verified Expert Solution
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 ,
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started