'int' object is not subscriptable
Получаю ошибку ERROR - Get current temperature error: 'int' object is not subscriptable При попытке выполнить куска кода
@admin_commands
def get_cuurent_temperature(update, context):
chat_id = update.message.chat_id
try:
# conn = sqlite3.connect(SQLITE_DB_FILENAME)
# cursor = conn.cursor()
# row = cursor.execute('select temperature from celsread where id = 1').fetchone()
# conn.close()
ss = str(subprocess.run(['cat', '/sys/bus/w1/devices/w1_bus_master1/28-000e9843003d/w1_slave'],
stdout=subprocess.PIPE, text=True))
t = float(search(r'(?<=t=)\d+\.?\d*', ss).group())
t = t/1000
row = round(t)
text = "Температура в системе {0}".format(row[0])
context.bot.send_message(chat_id, text, reply_markup=ReplyKeyboardMarkup(INFO_MENU, resize_keyboard=True))
except Exception as e:
logger.error('Get current temperature error: %s', str(e))
text = "Не удалось получить температуру из-за проблем с БД, Попробуйте еще раз."
context.bot.send_message(chat_id, text, reply_markup=ReplyKeyboardMarkup(INFO_MENU, resize_keyboard=True))
Это телеграм бот, в котором я попытался внести изменения. Понимаю, что проблема в text = "Температура в системе {0}".format(row[0]), но я не разработчик и причину понять не могу. Прошу помощи.