[Tkinter-discuss] tkinter file dialog pattern matching

Cameron Laird Cameron at phaseit.net
Sun Aug 23 00:51:02 CEST 2015


On Sat, Aug 22, 2015 at 10:17:11PM +0200, Laura Creighton wrote:
> In a message of Sat, 22 Aug 2015 21:04:24 +0100, Pawel Mosakowski writes:
> >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
> 
> Thank you.  Looks like it will be necessary to construct a new
> widget.  I'm surprised ...
			.
			.
			.
More than I.  I can understand your disappointment that 
file-dialogue "file patterns" have such a rudimentary
syntax; I speculate with considerable confidence that
the authors acted with sh as the model most in their
mind.  You're quite right, Laura, that the elements are
at hand to allow you to construct your own variant.  If
the history of getOpenFile truly interests you, act 
quickly:  while we can get to the authors now, it won't
be many cycles more before their memories and records
senesce irretrievably.


More information about the Tkinter-discuss mailing list