SB
Size: a a a
SB
💭П
💭П
in
💭П
💭П
for root, dirs, files in _walk:
for name in files:
if not name.startswith('_'):
_full_path = os.path.join(root, name)
if os.path.isfile(_full_path):
_all_file.append(_full_path)
💭П
IA
💭П
IA
💭П
💭П
💭П
def get_file(_path: str) -> list:вот
_all_file = list()
_walk = [obj for obj in os.walk(_path)]
for root, dirs, files in _walk:
for name in files:
if not name.startswith('_'):
_full_path = os.path.join(root, name)
if os.path.isfile(_full_path):
_all_file.append(_full_path)
_all_file = [_file for _file in _all_file if os.path.splitext(_file)[1] == ".py"]
return _all_file
_all_fileи
returnбыл смещён на 4 пробела (
💭П
SB
_walk = [obj for obj in os.walk(_path)]
💭П
_walk = [obj for obj in os.walk(_path)]
SB
walk_my_way = functools.partial(os.walk, _path)
for root, dirs, files in walk_my_way():