MXC_A39_20240320/SW/examples/clear_unused_file.py

18 lines
526 B
Python

import os
for home, dirs, files in os.walk('.'):
if 'MDK-ARM' in home:
for file in files:
if os.path.splitext(file)[-1] != '.uvprojx' \
and os.path.splitext(file)[-1] != '.sct' \
and os.path.splitext(file)[-1] != '.bat':
os.remove(home+'\\'+file)
#print(home+file)
elif 'GCC' in home:
for file in files:
if file == "Makefile":
pass
else:
os.remove(home+'\\'+file)