首页 > 代码库 > python TypeError: 'builtin_function_or_method' object is not iterable keys

python TypeError: 'builtin_function_or_method' object is not iterable keys

            statinfo = os.stat( OneFilePath )
            if AllFiles.has_key( statinfo.st_size ):
                OneKey = AllFiles[ statinfo.st_size ]
                OneKey.append( OneFilePath )
                AllFiles[ statinfo.st_size ] = OneKey
            else:
                if statinfo.st_size  > MinSize:
#                    print statinfo.st_size
                    AllFiles[ statinfo.st_size] = [ OneFilePath ]




is changed to


            statinfo = os.stat( OneFilePath )
            if AllFiles.has_key( statinfo.st_size ):
                OneKey = AllFiles[ statinfo.st_size ]
                OneKey.append( OneFilePath )
                AllFiles[ statinfo.st_size ] = OneKey
            else:
                if statinfo.st_size  > MinSize:
#                    print statinfo.st_size
                    FileSize = statinfo.st_size
                    AllFiles[ FileSize ] = [ OneFilePath ]






python TypeError: 'builtin_function_or_method' object is not iterable keys