Python Forum
list, int and .grid() come on!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list, int and .grid() come on!
#4
Actually this code will give you

Error:
Traceback (most recent call last): File "***", line 8, in <module> piece_counter = piece_counter[piece_index].grid(row = r, IndexError: list index out of range
that is because piece_counter is empty list and there is no element at index 0.
please, post actual code you run as well as full traceback you get (not just the last line).

also note that start imports are generally discouraged
better
import tkinter as tk and then use the tk to fully reference whatever you used from imported module.
Davy_Jones_XIV likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
list, int and .grid() come on! - by Davy_Jones_XIV - Jan-23-2021, 08:44 PM
RE: list, int and .grid() come on! - by BashBedlam - Jan-23-2021, 08:56 PM
RE: list, int and .grid() come on! - by buran - Jan-23-2021, 09:04 PM
RE: list, int and .grid() come on! - by BashBedlam - Jan-23-2021, 09:16 PM
RE: list, int and .grid() come on! - by deanhystad - Jan-23-2021, 10:05 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020