I feel that assigning files, and folders and doing the += [item] part is a bit hackish. Any suggestions? I\'m using Python 3.2
from os import * from os.pat
def dir_contents(path): files,folders = [],[] for p in listdir(path): if isfile(p): files.append(p) else: folders.append(p) return files, folders