import rarfile import os
def create_rar(file_paths, output_path): try: with rarfile.RarFile(output_path, 'w') as rar: for file_path in file_paths: rar.write(file_path, os.path.basename(file_path)) print(f"Successfully created {output_path}") except Exception as e: print(f"An error occurred: {e}") All my hvh.rar
import rarfile