elif( listb[0] == \"-test\"):
run_all.set(\"testview\")
listb.pop[0]
ERROR: Exception in Tkinter callback T
This error arises when you don't use brackets with pop
operation. Write the code in this manner.
listb.pop(0)
This is a valid python expression.
Looks like you typed brackets instead of parenthesis by mistake.
instead of writing listb.pop[0]
write
listb.pop()[0]
^
|
Mad a similar error, easy to fix:
TypeError Traceback (most recent call last) <ipython-input-2-1eb12bfdc7db> in <module>
3 mylist = [10,20,30] ----> 4 arr = np.array[(10,20,30)] 5 d = {'a':10, 'b':20, 'c':30} TypeError: 'builtin_function_or_method' object is not subscriptable
but I should have written it as:
arr = np.array([10,20,30])
Very fixable, rookie/dumb mistake.
I think you want
listb.pop()[0]
The expression listb.pop
is a valid python expression which results in a reference to the pop
method, but doesn't actually call that method. You need to add the open and close parentheses to call the method.
You are trying to access pop as if was a list or a tupple, but pop is not. It's a method.