Created
June 1, 2022 19:59
-
-
Save AlgorithmAlchemy/0bc4a643541be361bdadaf7291f27be5 to your computer and use it in GitHub Desktop.
Пересоздаём папку
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# предварительно чистим кэш чистим кэш видео в папке с файлом | |
try: | |
dir_name = "cache/" | |
files = os.listdir(dir_name) | |
fl_cnt = 0 | |
for i in files: | |
fl_cnt += 1 | |
print("cash_file:", fl_cnt, " ", i) | |
if fl_cnt >= 1: | |
shutil.rmtree(dir_name) | |
# создаём пустую (папку) | |
os.mkdir(dir_name) | |
# await asyncio.sleep(20) | |
except FileNotFoundError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment