File size: 286 Bytes
318db6e
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import os

existing_indexs = []
for root, dirs, files in os.walk("/data1/home/purui/projects/chatbot/kb"):
    for dir in dirs:
        existing_indexs.append(os.path.join(root, dir))
        # 退出循环,因为我们只想要第一层的目录
    break
    
print(existing_indexs)