-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset.py
More file actions
25 lines (21 loc) · 788 Bytes
/
reset.py
File metadata and controls
25 lines (21 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
def deletar_arquivos(output_dir='arquivos_aleatorios'):
if os.path.exists(output_dir):
for file_name in os.listdir(output_dir):
file_path = os.path.join(output_dir, file_name)
if os.path.isfile(file_path):
os.remove(file_path)
os.rmdir(output_dir)
def limpar_arquivos(output_dir='diretorio_temporario'):
# Apagar arquivo temporário se existir
tmp_file = os.path.join(output_dir, 'arquivo_temporario.tmp')
if os.path.exists(tmp_file):
os.remove(tmp_file)
os.rmdir(output_dir)
# Apagar o arquivo final se existir
final_file = 'contagem_final'
if os.path.exists(final_file):
os.remove(final_file)
if __name__ == "__main__":
limpar_arquivos()
deletar_arquivos()