1 Star 0 Fork 0

刻BITTER/simple_led_controller

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
exec-clean.py 672 Bytes
一键复制 编辑 原始数据 按行查看 历史
刻BITTER 提交于 2024-04-04 13:28 . initial
from pathlib import Path
import os
from send2trash import send2trash
from traceback import print_exc
from gitignore_parser import parse_gitignore
HERE_PATH = Path(os.path.dirname(__file__))
matches = parse_gitignore(HERE_PATH / '.gitignore', HERE_PATH)
files_to_be_deleted = []
for f in HERE_PATH.iterdir():
if(matches(f)):
files_to_be_deleted.append(f)
print('== FILES TO BE DELETED ==')
file_name_list = [t.name for t in files_to_be_deleted]
print('\n'.join(file_name_list))
print('->? Continue?')
print()
os.system('pause')
for f in files_to_be_deleted:
try:
send2trash(f)
except e:
print_exc()
os.system('pause')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/etberzin/simple_led_controller.git
git@gitee.com:etberzin/simple_led_controller.git
etberzin
simple_led_controller
simple_led_controller
main

搜索帮助