Don't you just love writing this sort of thing :)

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Wed Dec 3 20:07:46 EST 2008


for \
        Entry \
    in \
        sorted \
          (
            f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None
          ) \
:
    Patch = (open, gzip.GzipFile)[Entry.endswith(".gz")](os.path.join(PatchesDir, Entry), "r")
    ... read from Patch ...
    Patch.close()
#end for




More information about the Python-list mailing list