This question already has an answer here:
so in the below code I am not getting the required files instead I am getting all the files. I couldn't understand the problem.
for i in range(len(files)):
filename,exten=os.path.splitext(files[i])
#print(exten)
if exten == '.jpg' or '.txt':
print(files[i])
Aucun commentaire:
Enregistrer un commentaire