Staging
v0.8.1
https://github.com/python/cpython
Revision db68544122f5a0c7b80f69c0e643049efa6699c6 authored by Zackery Spytz on 03 December 2020, 17:22:04 UTC, committed by GitHub on 03 December 2020, 17:22:04 UTC
1 parent 8b6c4a9
Raw File
Tip revision: db68544122f5a0c7b80f69c0e643049efa6699c6 authored by Zackery Spytz on 03 December 2020, 17:22:04 UTC
bpo-42523: Fix supported versions in "Using Python on Windows" (GH-23603)
Tip revision: db68544
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