因此,下面的代码应该获取x的结果元组中的第一个元素,并将其转换为要使用的字符串。但是,当执行最后一行时,它告诉我它不能从元组转换为str
for x in filelink:
print(x[0])
item = str(x[0])
oldpath = root.wgetdir + "\\" + root.website.get() + "\\" + item
print(oldpath)
if os.path.exists(oldpath): shutil.copy(root.wgetdir + "\\" + root.website.get() + "\\" + x, keyworddir + "\\" + item)
本部分:
正在使用元组而不是
item
。在相关问题 更多 >
编程相关推荐