On Tue, 10 Aug 2010 10:40:53 +0200, Eric Brunel <eric.bru...@pragmadev.com> wrote:
>In article <d4m1661blus6baj1lrd37j5vk4dau35...@4ax.com>, John wrote: > >> As a learning exercise in Tkinter I htought about making a very simple >> and basic file manager for my own use. I tried searching google for >> any sample project and could not find anything. Not exactly sure how >> to start I tought I could ask here? >> >> I thought about making two listboxes one to list folders only the >> other files inside. I tried to make one listbox first but did not know >> how to list folders only. > >You just have to filter them explicitely by using os.path.isdir on each >file name. > >> from Tkinter import * >> import os >> path = "D:\\" >> >> >> s = Scrollbar() >> L = Listbox() >> >> s.pack(side=RIGHT, fill=Y) >> L.pack(side=LEFT, fill=Y) >> >> s.config(command=L.yview) >> L.config(yscrollcommand=s.set) >> >> for filename in os.listdir(path): > >Add here: > if os.path.isdir(os.path.join(path, filename)): >> L.insert(END, filename) >> >> mainloop() >> >> >> >> Is there a way to list folders with images? > >AFAIK, not with a Listbox. You can do it with a Canvas, but it's much >more complicated than using a Listbox, so maybe you should try to make >your Listbox-only version works first. > >> Any suggestions or help how to proced would be appreciated. >> >> Thank you > >Good luck! Thank you both for the suggestions. Have you ever tried to make one? -- http://mail.python.org/mailman/listinfo/python-list