Staging
v0.5.1
https://github.com/python/cpython
Revision f74cabd9203cf3be97fdb3821a7fa0b74d7b2263 authored by Ned Deily on 11 December 2018, 09:28:31 UTC, committed by GitHub on 11 December 2018, 09:28:31 UTC
1 parent 8855d93
Raw File
Tip revision: f74cabd9203cf3be97fdb3821a7fa0b74d7b2263 authored by Ned Deily on 11 December 2018, 09:28:31 UTC
[3.6] bpo-15663: the 10.6+ macOS installers for 3.6/2.7 now provide a private Tcl/Tk 8.6 (GH-11109)
Tip revision: f74cabd
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