From fa6a3335e4d0f0b9fa14f24a7af102d092767881 Mon Sep 17 00:00:00 2001 From: Red-exe-Engineer <90420989+Red-exe-Engineer@users.noreply.github.com> Date: Wed, 10 Aug 2022 00:30:35 -0400 Subject: [PATCH] Change for loop to use enumerate --- main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.py b/main.py index bc4a93a..7027ee4 100644 --- a/main.py +++ b/main.py @@ -172,9 +172,7 @@ def reload_nbt(self): self.slots = [] for child in self.scrollable_frame.winfo_children(): child.destroy() - i = 0 - for slot in context.nbt_file['Player'].value[self.name].value: - i = i + 1 + for i, slot in enumerate(context.nbt_file['Player'].value[self.name].value): if i > self.total_slots: break self.slots.append(create_slot(self.scrollable_frame, slot['id'].value, slot['Count'].value, slot['Damage'].value, i))