Staging
v0.5.1
Revision cf49e2053a057c4cf59d889d60eec8140eafa3ef authored by Benjamin Peterson on 26 June 2008, 21:45:04 UTC, committed by Benjamin Peterson on 26 June 2008, 21:45:04 UTC
........
  r64546 | benjamin.peterson | 2008-06-26 16:24:35 -0500 (Thu, 26 Jun 2008) | 1 line

  use the new API
........
  r64547 | benjamin.peterson | 2008-06-26 16:29:19 -0500 (Thu, 26 Jun 2008) | 1 line

  fix isSet in _exposed
........
1 parent 85f7604
Raw File
rmpyc.py
# Remove all the .pyc and .pyo files under ../Lib.


def deltree(root):
    import os
    from os.path import join

    npyc = npyo = 0
    for root, dirs, files in os.walk(root):
        for name in files:
            delete = False
            if name.endswith('.pyc'):
                delete = True
                npyc += 1
            elif name.endswith('.pyo'):
                delete = True
                npyo += 1

            if delete:
                os.remove(join(root, name))

    return npyc, npyo

npyc, npyo = deltree("../Lib")
print(npyc, ".pyc deleted,", npyo, ".pyo deleted")
back to top