@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
if call.message:
for row in call.message.json['reply_markup']['inline_keyboard']:
if call.data==row[0]['callback_data']:
print(f'Текст на нажатой кнопке: {row[0]["text"]}')
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
if call.message:
for row in call.message.json['reply_markup']['inline_keyboard']:
print(row[0]['text'])
-H "Content-Type: application/json"
curl -i -X POST -d '{"data": "some_data"}' -H "Content-Type: application/json" http://127.0.0.1:5000/api/func/1/
INSERT INTO RESULTS (UNIXDATE, ACTION, CURRENCY, AMOUNT)
SELECT bb.UNIXDATE, 'BUY', 'BTC', bb.AMOUNT FROM BTC_BUY bb
UNION ALL
SELECT bs.UNIXDATE, 'SELL', 'BTC', bs.AMOUNT FROM BTC_SELL bs
UNION ALL
SELECT eb.UNIXDATE, 'BUY', 'ETH', eb.AMOUNT FROM ETH_BUY eb
UNION ALL
SELECT es.UNIXDATE, 'SELL', 'ETH', es.AMOUNT FROM ETH_SELL es
ORDER BY UNIXDATE ASC;
def formatter(s):
return s.replace("\\n", "\n").replace("\\t", "\t")# and etc.
data = (('aaa', 'bbb', 'ccc',), ('ddd', 'fff', 'eee'), ('ggg', 'hhh', 'mmm'))
def find_index(embedded_elem, data_set):
for elem in data_set:
if embedded_elem in elem:
print(data.index(elem)) # индекс внешнего элемента
print(elem.index(embedded_elem)) # индекс внутреннего
>>>find_index('hhh', data)
>>>
2
1
>>> find_index('ddd', data)
>>>
1
0