def glob_tildes_at_end(path):
 result = glob(path)
 with_tildes = [f for f in result if f.endswith('~')]
 no_tildes = [f for f in result if (not f.endswith('~'))]
 return (no_tildes + with_tildes)

def glob_tildes_at_end ( path ) : result = glob ( path ) with_tildes = [ f for f in result if f . endswith ( '~' ) ] no_tildes = [ f for f in result if ( not f . endswith ( '~' ) ) ] return ( no_tildes + with_tildes )
a wrapper for the glob .