<s> from win32com . shell import shell , shellcon <EOL> def walk ( folder , depth = <NUM_LIT:2> , indent = "<STR_LIT>" ) : <EOL> try : <EOL> pidls = folder . EnumObjects ( <NUM_LIT:0> , shellcon . SHCONTF_FOLDERS ) <EOL> except shell . error : <EOL> return <EOL> for pidl in pidls : <EOL> dn = folder . GetDisplayNameOf ( pidl , <EOL> shellcon . SHGDN_NORMAL ) <EOL> print indent , dn <EOL> if depth : <EOL> try : <EOL> child = folder . BindToObject ( pidl , None , <EOL> shell . IID_IShellFolder ) <EOL> except shell . error : <EOL> pass <EOL> else : <EOL> walk ( child , depth - <NUM_LIT:1> , indent + "<STR_LIT:U+0020>" ) <EOL> walk ( shell . SHGetDesktopFolder ( ) ) </s>
