用os找到文件后缀来判断
fileTypes = []
for file in os.listdir(filePath3):
fileType = file.split('.')[-1]
fileTypes.append(fileType)
while 'crdownload' in fileTypes:
print('下载进行中...如文件夹中存在下载失败的文件,请删除')
time.sleep(15)
fileTypes = []
for file in os.listdir(filePath3):
fileType = file.split('.')[-1]
fileTypes.append(fileType)