У меня есть 500 изображений в папке.Я хочу удалить нечитаемые изображения, используя обработку исключений в python.
Когда я использую:
os.remove()
, тогда я получаю сообщение об ошибке:
[WinError 3] The system cannot find the path specified: '-coast-ocean-horizon-sky-sunrise-sunset-dawn-atmosphere-plane-dusk-vehicle-flight-island-yellow-shadows-colors-holidays-hot-reflections-the-mediterranean-sea-sunset-sun-aegean-sea-atmosphere-of-earth-484653.jpg' "
, так какthis
-coast-ocean-horizon-sky-sunrise-sunset-dawn-atmosphere-plane-dusk-vehicle-flight-island-yellow-shadows-colors-holidays-hot-reflections-the-mediterranean-sea-sunset-sun-aegean-sea-atmosphere-of-earth-484653.jpg')
- первое изображение, которое невозможно прочитать при переборе по циклу, как мне его решить?