Staging
v0.8.1
Revision 581b8606ca0609cf36c4eb9a5bb025eb77540e5e authored by Miss Islington (bot) on 14 February 2020, 00:03:59 UTC, committed by GitHub on 14 February 2020, 00:03:59 UTC

https://bugs.python.org/issue39545
(cherry picked from commit f632736023502816f2e6bd714d1b48c81aa2ccc1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 8dbdf5f
Raw File
rmpyc.py
# Remove all the .pyc files under ../Lib.


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

    npyc = 0
    for root, dirs, files in os.walk(root):
        for name in files:
            # to be thorough
            if name.endswith(('.pyc', '.pyo')):
                npyc += 1
                os.remove(join(root, name))

    return npyc

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