-1

I currently have for current_dir, dirnames, unfilenames in os.walk(input_dir): which works fine. I'd like to be able to store an iteration variable i.

for i, current_dir, dirnames, unfilenames in os.walk(input_dir):

returns the following error: ValueError: need more than 3 values to unpack. How can I fix this?

inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241
bmikolaj
  • 485
  • 1
  • 5
  • 16

1 Answers1

2
for i, (current_dir, dirnames, filenames) in enumerate(os.walk(input_dir)):
Bill Lynch
  • 80,138
  • 16
  • 128
  • 173