
Python
1
Вклад в тег
for root, dirs, files in os.walk(path_dir_file, topdown=False):
for file in files:
try:
os.unlink(file)
os.sync() # синхронизируем
except OSError as e:
if not os.path.exists(file): # проверяем удален ли файл
continue
raise
shutil.rmtree(path_dir_file) # только теперь удаляем директорию
UUID=UUID-HDD /mnt/sdb1 ntfs rw,sync,noatime,relatime,uid=UUID-AIRFLOW,gid=UUID-AIRFLOW,force,dmask=002,fmask=113,nofail 0 0
import telebot
bot = telebot.TeleBot("TOKEN" )
@bot.message_handler(content_types=['text'])
def send_echo(message):
bot.send_message(message.chat.id, message.text)
bot.polling(none_stop=True)