def get_filetype_icon ( fname ) : ext = osp . splitext ( fname ) [ 1 ] if ext . startswith ( '.' ) : ext = ext [ 1 : ] return get_icon ( "%s.png" % ext , ima . icon ( 'FileIcon' ) )
python get file icon from extension
Return file type icon
def get_filetype_icon(fname):
    """Return file type icon"""
    ext = osp.splitext(fname)[1]
    if ext.startswith('.'):
        ext = ext[1:]
    return get_icon( "%s.png" % ext, ima.icon('FileIcon') )