In PySide, when I use QDirIterator
, how I can filter on files by name?
In the documentation, it talks about the parameter nameFilters
:
But when I try it, it doesn't filter the files by extension:
from PySide import QtCore
it = QtCore.QDirIterator('.', nameFilters=['*.py'])
while it.hasNext():
print it.next()
>> ./.
>> ./..
>> my_script.py
>> another_file.txt
With this code, I expected to get only the files with the extension .py
.