Answer the question
In order to leave comments, you need to log in
Error when working with a database in Python?
with sqlite3.connect(config.db_name) as conn:
cursor = conn.cursor()
stmt = "SELECT token FROM users WHERE username=:login"
args = {'login': call.message.from_user.username}
cursor.execute(stmt, args)
row = cursor.fetchone()
token = row[0]['token']
2019-11-03T09:32:54.785202+00:00 app[bot.1]: token = row[0]['token']
2019-11-03T09:32:54.78522+00:00 app[bot.1]: TypeError: 'NoneType' object is not subscriptable
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question