Staging
v0.8.1
v0.8.1
Revision 7444a5a402bbac4268b95958a9578a9e3dae33e0 authored by Miss Islington (bot) on 25 September 2019, 15:24:12 UTC, committed by Raymond Hettinger on 25 September 2019, 15:24:12 UTC
Improvement suggested by Géry Ogam. (cherry picked from commit 15ccc4fac09b866d61b069c6c136aabfe4bac09c) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
1 parent e4be8c9
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")
Computing file changes ...