From 7bd14ec4dfe4e5a7eb229bca0f9474933341535d Mon Sep 17 00:00:00 2001 From: tzwm Date: Fri, 22 Mar 2024 14:50:02 +0800 Subject: [PATCH] move exist result to another directory for xyz_plot --- nodes/xyz_plot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nodes/xyz_plot.py b/nodes/xyz_plot.py index 36cbd9f..4f7c704 100644 --- a/nodes/xyz_plot.py +++ b/nodes/xyz_plot.py @@ -1,3 +1,5 @@ +import shutil +import time import requests import json from PIL import Image @@ -93,6 +95,8 @@ class XyzPlot: self.save_images(images) return () + if os.path.exists(self.output_folder_name): + shutil.move(self.output_folder_name, self.output_folder_name + f'_old_{int(time.time())}') def filter_values(value): return list(filter(lambda x: x != '', value.split(";")))