хотел пролистать все файлы с помощью библиотеки Оs, но это оказалось очень долго, решил использовать библиотеку Numba , но не получилось выходит ошибка
Код:
import os
from numba import njit
@njit()
def walki():
path = 'C:\\Windows'
print(numpy.array(os.walk(path)))
walki()
ошибка:
Traceback (most recent call last):
File "C:/Users/*****/PycharmProjects/******/crypt/test.py", line 28, in <module>
walki()
File "C:\Users\*****\AppData\Local\Programs\Python\Python38\lib\site-packages\numba\core\dispatcher.py", line 415, in _compile_for_args
error_rewrite(e, 'typing')
File "C:\Users\*****\AppData\Local\Programs\Python\Python38\lib\site-packages\numba\core\dispatcher.py", line 358, in error_rewrite
reraise(type(e), e, None)
File "C:\Users\****\AppData\Local\Programs\Python\Python38\lib\site-packages\numba\core\utils.py", line 80, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Unknown attribute 'walk' of type Module(<module 'os' from 'C:\\Users\\*****\\AppData\\Local\\Programs\\Python\\Python38\\lib\\os.py'>)
File "test.py", line 15:
def walki():
<source elided>
path = 'C:\\Windows'
print(numpy.array(os.walk(path)))
^
During: typing of get attribute at C:/Users/*****/PycharmProjects/****/crypt/test.py (15)
File "test.py", line 15:
def walki():
<source elided>
path = 'C:\\Windows'
print(numpy.array(os.walk(path)))
^
Process finished with exit code 1