Re: tkinter file dialog pattern matching

Pawel Mosakowski <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <20150822210424.321b826f@lenny>
Hi,

I've found this little gem in the Tk docs
https://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm#M13
From what I see "file patterns" in the file dialog are not "regex
patterns" and do not support special characters. Only things that work
are:
1) * - any extension
2) "" - files without extension
3) literal extension without wildcard chars
Unfortunately it looks like there is no simple way to filter out hidden
files.
Check out this answer
https://mail.python.org/pipermail//tutor/2011-November/086483.html

Regards,
Pawel Mosakowski

On Sat, 22 Aug 2015 13:03:46 +0200
Laura Creighton <[email protected]> wrote:

> Somebody on the tutor mailing list wants to match
> "all files and direcories in this directory that do not start
> with a ."
> 
> The filetypes option seems only to want patterns to match, not
> patterns to exclude.  Is my pattern matching magic just off, or
> is there no way to exclude things in a tkFileDialog?
> 
> puzzled,
> Laura
> _______________________________________________
> Tkinter-discuss mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.