From 1add7185a8109aa088afe773eab795824aa52b20 Mon Sep 17 00:00:00 2001 From: yogibaba Date: Sat, 5 Sep 2020 12:16:20 +0530 Subject: [PATCH] file name with datetime --- truchet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/truchet.py b/truchet.py index f346bf0..92af561 100644 --- a/truchet.py +++ b/truchet.py @@ -1,5 +1,6 @@ import random as rnd from itertools import product +from datetime import datetime import cairosvg import svgwrite @@ -98,8 +99,7 @@ def draw_truchet(frame_positions, col, row, max_depth, colors): ''')) cairosvg.svg2png(dwg.tostring().encode('utf-8'), - write_to='truchet.png', scale=2000 / dwg['width']) - + write_to='{}-truchet.png'.format(datetime.now().strftime('%Y%m%d%H%M%S')), scale=2000 / dwg['width']) def main(col=5, row=5, max_depth=5, colors=('white', 'black')): frame_positions = decide_frame_position(col, row, max_depth)