From ac9be1527074f2652f728bbcd1d3a541c54cfb8c Mon Sep 17 00:00:00 2001 From: ManuelW Date: Sat, 11 May 2024 10:59:22 +0200 Subject: [PATCH] DB config --- parseFitFiles.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parseFitFiles.py b/parseFitFiles.py index ca82ea3..04002f8 100644 --- a/parseFitFiles.py +++ b/parseFitFiles.py @@ -129,10 +129,10 @@ def writeDB(): def deleteFiles(filename): try: - file = filename[:-4] - #print(file) - os.unlink(path+file+".*") - print("lösche", file) + for fname in os.listdir(path): + if fname.startswith(filename[:-4]): + os.remove(os.path.join(path, fname)) + print("lösche", fname) except Exception as e: print('Failed to delete %s. Reason: %s' % (path+filename, e))