I wanna wait for a file to donwload, and I want to check on a folder while the file not exists I'll put a time untill the file finish the download. The problem is I wanna check if the file exists starting with a substring variable called 'final_name' and ends with '.csv'. Could someone help me?
final_name = name.replace(" ", "").replace('(', '').replace(')', '').replace('-', '')\
.replace('/', '').replace(r"'", '')
print(final_name)
time.sleep(5)
while not os.path.exists(final_name):
time.sleep(1)