_ = all([x for x in os.listdir(f"{os.getenv('USERPROFILE')}\\Downloads") if x.endswith(("crdownload", "tmp"))] and not time.sleep(1) and not print(f"{f'{datetime.datetime.now()}'[:-4]} download in progress...") and i for i in itertools.repeat(1)) ※(注記)importを必要に応じて記述ください。 ※(注記)C:\Users\USERNAME\Downloadsがダウンロードフォルダの場合のコードです。 ※(注記)C:\Users\USERNAME\Downloadsにfoo.crdownloadやbar.tmpがあるとループ処理状態になります。 tmp ⇒ crdown