def copy_to_clipboard(new_list): new_list[-1] = '\n' + new_list[-1] new_text = ''.join(new_list) pyperclip.copy(new_text) print("The new string is now copied to the clipboard. Hit CTRL V to paste.")