Skip to content

Instantly share code, notes, and snippets.

@AlgorithmAlchemy
Created June 1, 2022 19:59
Show Gist options
  • Save AlgorithmAlchemy/0bc4a643541be361bdadaf7291f27be5 to your computer and use it in GitHub Desktop.
Save AlgorithmAlchemy/0bc4a643541be361bdadaf7291f27be5 to your computer and use it in GitHub Desktop.
Пересоздаём папку
# предварительно чистим кэш чистим кэш видео в папке с файлом
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