0
I want to make a program that detects if it has a specific "text" in the input typed by the user.
In this example, the "text": 100
I want it to detect this 100 (position independent) in the input. Example: test100 or 100test
I am wanting to develop this program, to delete files. Let’s assume that I have the files: "T100.txt", "A100.txt", "B100.txt". I want it to delete every file that contains "100" in the title.
import os
#Arquivos
a1 = open('t100.txt', 'r+')
a2 = open('a100.txt', 'r+')
a3 = open('b100.txt', 'r+')
string = input('Você deseja excluir todos os arquivos que contém qual string: ')
if string[] == '100':
print("Removendo os arquivos que contém '100' no título")
os.remove()
else:
print("Não há arquivos que contém '100' no título")
In the title or file name ?
– NoobSaibot
File name, I ended up confusing :x
– BRKappa