import os import shutil # Define source and destination directories source_dir = 'tts_models' destination_dir = '/home/user/.local/share/tts/' # Create destination directory if it doesn't exist os.makedirs(destination_dir, exist_ok=True) # Copy all contents from source to destination for item in os.listdir(source_dir): source_path = os.path.join(source_dir, item) destination_path = os.path.join(destination_dir, item) # Copy files or directories if os.path.isdir(source_path): shutil.copytree(source_path, destination_path, dirs_exist_ok=True) else: shutil.copy2(source_path, destination_path) print("Contents copied successfully.")