path is a StringProperty and defaults to the current working directory
as a unicode string. It specifies the path on the filesystem that this
controller should refer to.
Warning
If a unicode path is specified, all the files returned will be in
unicode, allowing the display of unicode files and paths. If a bytes
path is specified, only files and paths with ascii names will be
displayed properly: non-ascii filenames will be displayed and listed
with questions marks (?) instead of their unicode characters.
filters specifies the filters to be applied to the files in the
directory. filters is a ListProperty and defaults to []. This is
equivalent to ‘*’ i.e. nothing is filtered.
The filters are not reset when the path changes. You need to do that
yourself if desired.
There are two kinds of filters: patterns and callbacks.
Patterns
e.g. [‘*.png’]. You can use the following patterns:
Pattern Meaning
* matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any character not in seq
Callbacks
You can specify a function that will be called for each file. The
callback will be passed the folder and file name as the first and
second parameters respectively. It should return True to indicate a
match and False otherwise.
解决方案/提示如下。你知道吗
path
和filters
代码段
FileChooser » path
FileChooser » filters
相关问题 更多 >
编程相关推荐