import os new_directory = "new_dir.txt" try: os.makedirs(new_directory) print(f"Directory '{new_directory}' created successfully.") except OSError as e: print(f"Error: Failed to create directory '{new_directory}'. {e}")