Code: Alles auswählen
def spezial_cmp(a,b):
""" Sortiert alle mit "_" beginnenen items nach oben """
x = a[0][0] == "_" # x ist True wenn erste Buchstabe ein "_" ist
y = b[0][0] == "_"
if x and y: return 0
if x: return -1
if y: return 1
return cmp(a,b)
dirs.sort(spezial_cmp)