[Tutor] filtering listed directories

Laura Creighton lac at openend.se
Sun Aug 23 10:13:31 CEST 2015

In a message of Sun, 23 Aug 2015 13:09:41 +1000, Chris Roy-Smith writes:
>On 22/08/15 23:32, Alan Gauld wrote:
>> On 22/08/15 11:43, Laura Creighton wrote:
>>>> How can I filter out these hidden directories?
>>>> Help(tkFileDialog) doesn't help me as it just shows **options, but
>>>> doesn't show what these options might be.
>>> tix (tkinter extensions) https://wiki.python.org/moin/Tix
>>> have some more file dialogs, so maybe there is joy there.
>> There is a FileSelectDialog in Tix that has a dircmd option
>> according to the Tix documentation.
>> However, I've played about with it and can't figure out how
>> to make it work!
>> There is also allegedly a 'hidden' check-box subwidget
>> that controls whether hidden files are shown. Again I
>> couldn't find how to access this.
>> But maybe some questions on a Tix (or Tk) forum might
>> get more help? Once you know how to do it in native
>> Tcl/Tk/Tix you can usually figure out how to do it
>> in Python.
>Thanks for the Tcl tk hint, so I searched for info for tcl tk. 
>Unfortunately the options appear to be the same as offered by tkinter. I 
>had hoped that the cause of my problem would be that I'm still to learn 
>that bit ;)

No, the problem is that the tk widget is badly designed.  Not only is
there only minimal pattern support matching, but there is no way to
subclass the thing and feed it your own list of file and directory
names.  It really is a case of "Do not open.  No user-servicable
parts to be found within." which is frustrating.


More information about the Tutor mailing list