Lyner Lim Posted on Mar 4, 2025 • Edited on Mar 4, 2025 Python - datetime as filename #python filename = f'{datetime.now():%Y-%m-%d-%H%M}' with open(f'{filename}.txt', 'w') as file: file.write('hello') Enter fullscreen mode Exit fullscreen mode Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)