File Manager in Tkinter

John John
Tue Aug 10 06:53:10 CEST 2010


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.

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):
  L.insert(END, filename)

mainloop()



Is there a way to list folders with images?
Any suggestions or help how to proced would be appreciated.

Thank you



More information about the Python-list mailing list