documentList = ['D:\\My files\\Desktop\\telegram\\прайс 16 апрель.xls',
'D:\\My files\\Desktop\\telegram\\прайс 17 апрель янги.xls',
'D:\\My files\\Desktop\\telegram\\Драг Промоущн прайс 19 апрель.xls',
'D:\\My files\\Desktop\\telegram\\прайс 21 апрель янги.xls']
@bot.callback_query_handler(func=lambda call: True)
def callback_worker(callback):
for row in documentList:
bot.send_document(callback.message.chat.id, open(row, 'rb'))
time.sleep(5)
import os
...
os.remove('/home/User/Documents/file.txt')
bot.edit_message_text(text='Новый текст', chat_id=message.chat.id, message_id=message.id, reply_markup=markup)
update_types=['edited_message']
@bot.middleware_handler(update_types=['edited_message'])
def foo(bot_instanse, message):
print(message)
var list = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var counter = 6;
var logics = {
"F10": "=IFERROR(VLOOKUP(B10;'Эта неделя'!$B$3:$E$120;3;FALSE);0)",
"G10": "=IFERROR(VLOOKUP(B10;'Эта неделя'!$B$3:$E$120;4;FALSE);0)",
"H10": "=IF(C10>=10;F10-70;(F10+G10)-70)+J10",
"I10": "=H10+J10"
}
for (var key in logics) {
formulaPaste (list, counter, key, logics[key]);
counter++;
}
function formulaPaste (list, i, cell, formula){
list.getRange(cell).setFormula(formula);
var row = list.getLastRow();
var range = list.getRange(10, i, row-9);
list.getRange(cell).copyTo(range);
}
function COUNTUNIQWORDS(cell) {
var result = []
var words = String(cell).split(" ");
var wordsCount = words.reduce(function (acc, w) {
if(acc[w]) {
acc[w] += 1
} else {
acc[w] = 1;
}
return acc;
}, {});
for (var w in wordsCount) result.push('Cлово "'+ w +'" встречается '+ wordsCount[w] + ' раз');
return result
}