python--中文显示乱码问题,很奇怪的现象 5
searchDirectoryResult是一个文件路径列表,如:searchDirectoryResult=['E:\KuGou\陈小春-独家记忆.mkv'],toSe...
searchDirectoryResult是一个文件路径列表,如:searchDirectoryResult = ['E:\KuGou\陈小春 - 独家记忆.mkv'],toSearchWord='kougou',运行后这个函数返回的列表在textbox里显示出来后中文是乱码,请教大神??
代码:
def listComparisonResult(searchDirectoryResult,toSearchWord):
search_Result = []
to_Search_List = searchDirectoryResult
tmp_Keyword = toSearchWord
for each in to_Search_List:
if tmp_Keyword.lower() in each.lower():
search_Result.append(each)
return search_Result 展开
代码:
def listComparisonResult(searchDirectoryResult,toSearchWord):
search_Result = []
to_Search_List = searchDirectoryResult
tmp_Keyword = toSearchWord
for each in to_Search_List:
if tmp_Keyword.lower() in each.lower():
search_Result.append(each)
return search_Result 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询