while True:
query_2 = cur.execute('''
select id,fatherID,dirandfile
from filesystem where id='{}' '''.format(file_path_id))#
value2 = query_2.fetchone()
file_path_id = value2[1]# 取数组的第1个数据
li_value2 = value2[2]# 赋值数据
bootdir = bootdir+','+li_value2 #连接字符串
li_bootdir = bootdir.split(',') # 以 ,'为分隔符,分割bootdir 字符串
if file_path_id =="C:":
li_bootdir.reverse() #反转列表
print("li_bootdir",li_bootdir)
print(findStr,"文件在","C:\\"+"\\".join(li_bootdir))# 用 反斜杠 \ 连接字符串
print("query ok !!!")
break
用PYTHON搞定了