Condensed the functions for readability.
Replaced list(map(...)) with list comprehensions.
Provided more verbose output for tracking progress. Used os.path.join and os.path.basename for safer path manipulation. Checked the minimum required command-line arguments and exited if not met. Utilized the if name == 'main': idiom for better script encapsulation.
Condensed the functions for readability. Replaced list(map(...)) with list comprehensions. Provided more verbose output for tracking progress. Used os.path.join and os.path.basename for safer path manipulation. Checked the minimum required command-line arguments and exited if not met. Utilized the if name == 'main': idiom for better script encapsulation.