diff --git a/parseFitFiles.py b/parseFitFiles.py index 4c7b7b0..42353c8 100644 --- a/parseFitFiles.py +++ b/parseFitFiles.py @@ -30,6 +30,8 @@ def main(): if filename.endswith(ext): processFIT(filename) deleteFiles(filename) + else: + os.remove(os.path.join(path, filename)) pass @@ -129,11 +131,7 @@ def writeDB(): def deleteFiles(filename): try: - for fname in os.listdir(path): - print("sehe file:", fname) - if fname.startswith(filename[:-4]): - os.remove(os.path.join(path, fname)) - print("lösche", fname) + os.remove(os.path.join(path, filename)) except Exception as e: print('Failed to delete %s. Reason: %s' % (path+filename, e))