Reputation: 9213
Simple code gives the below error. It's directly from the docs (https://docs.python.org/3/library/glob.html)
TypeError: iglob() got an unexpected keyword argument 'recursive'
import glob
for filename in glob.iglob('C:\\**\\*txt', recursive=True):
print filename
Upvotes: 5
Views: 7049
Reputation: 5084
The recursive
parameter has been added in python 3.5, which means version 3.4.3
also has that problem.
If you don't want to upgrade your python version, you can use glob2, which supports recursive calls (**
) by default.
Upvotes: 7
Reputation: 12142
It seems you're using Python 2.7 and reading the Python 3.5 documentation.
Upvotes: 9