import os
current_dir = os.getcwd()
def my_list(path):
for dirname, dirnames, filenames in os.walk(path):
filenames = filter(lambda x: x.endswith('.html'), filenames)
for filename in filenames:
file = os.path.join(dirname, filename)
# где-то тут return
print(my_list(current_dir))
import os
current_dir = os.getcwd()
for dirname, dirnames, filenames in os.walk(current_dir):
filenames = list(filter(lambda x: x.endswith('.html'), filenames))
for filename in filenames:
file = os.path.join(dirname, filename)
print(file)
def my_list(path):
filePaths = []
for dirname, dirnames, filenames in os.walk(path):
filenames = filter(lambda x: x.endswith('.html'), filenames)
for filename in filenames:
file = os.path.join(dirname, filename)
filePaths.append(file)
return filePaths
def my_list(path):
result = []
for dirname, dirnames, filenames in os.walk(path):
filenames = filter(lambda x: x.endswith('.html'), filenames)
for filename in filenames:
file = os.path.join(dirname, filename)
result.append(file)
return result