I'm struggling with the result of the Path.glob() method of the Pathlib module in Python 3.6.
from pathlib import Path
dir = Path.cwd()
files = dir.glob('*.txt')
print(list(files))
>> [WindowsPath('C:/whatever/file1.txt'), WindowsPath('C:/whatever/file2.txt')]
for file in files:
print(file)
print('Check.')
>>
Evidently, glob found files, but the for-loop is not executed. How can I loop over the results of a pathlib-glob-search?