From 7ea27abf3a41abc4ec86966c80fe4bae767164fa Mon Sep 17 00:00:00 2001 From: rasmusvt Date: Fri, 15 Jul 2022 11:25:27 +0200 Subject: [PATCH] Add function to get unique entries in list --- nafuma/auxillary.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nafuma/auxillary.py b/nafuma/auxillary.py index 96b9ce2..4734802 100644 --- a/nafuma/auxillary.py +++ b/nafuma/auxillary.py @@ -134,4 +134,15 @@ def backup_file(filename, backup_dir): dst = os.path.join(backup_dir, dst_basename) - shutil.copy(filename, dst) \ No newline at end of file + shutil.copy(filename, dst) + + +def get_unique(full_list): + + unique_list = [] + + for entry in full_list: + if not entry in unique_list: + unique_list.append(entry) + + return unique_list \ No newline at end of file