AttributeError: объект «tuple» не имеет атрибута «endswith»
Код: Выделить всё
import os
DIRECTORY = os.path.dirname(os.path.realpath(__file__))
EXTENTIONS = (".xlsx", ".xlsm", ".xltx", ".xltm")
files = os.walk(DIRECTORY)
for file in files:
if (file.endswith(EXTENTIONS)):
# Do something here
Подробнее здесь: https://stackoverflow.com/questions/607 ... tributeerr
Мобильная версия