Add a filter for the extension of a file in the file browser I'm writing a python script that allow us to open a file in it like that:



It's a string properties wich is coded like that :

bpy.props.StringProperty(description="Path of .DAT File", default="C:", subtype='FILE_PATH') 


When the user click on the little folder on right it open a file browser. 

In the file browser, in my case I want to filter only the .DAT files. I know that it's possible to filter the extension of file for exemple here it filter the .py or .zip file:



How can I do that with Python ?
Unfortunately this isnt documented, however it is used in the templates that come with blender, see Text -&gt; Templates -&gt; Python -&gt; Operator File Export, there is a filter_glob string property.

eg:

filter_glob = StringProperty(
        default="*.txt;*;*.py",
        options={'HIDDEN'},
        )