Answer the question
In order to leave comments, you need to log in
I'm blind? Where is NoneType?
There is some code, it connects to the local SQLite database, and issues information from it to the user ...
Base - collection of TEXT expressions, no INTEGER, and even more so None (NULL).
When trying to display information, an error occurs: TypeError: 'NoneType' object is not
subscriptable
Part of the code with an error:
cur.execute('SELECT * FROM sometable WHERE ' + where + '=' + query)
fetch = cur.fetchone()
var0 = fetch[0]
var1 = fetch[1]
var2 = fetch[2]
var3 = fetch[3]
var4 = fetch[4]
var5 = fetch[5]
print('Result:')
print('VAR0: ' + var0)
print('VAR1: ' + var1)
print('VAR2: ' + var2)
print('VAR3: ' + var3)
print('VAR4: ' + var4)
print('VAR5: ' + var5)
Answer the question
In order to leave comments, you need to log in
Where None sat down I don’t understand
fetch = cur.fetchone()
variable fetch
isNone
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question