Back to index

python3.2  3.2.2
Functions
rmpyc Namespace Reference

Functions

def deltree

Function Documentation

def rmpyc.deltree (   root)

Definition at line 4 of file rmpyc.py.

00004 
00005 def deltree(root):
00006     import os
00007     from os.path import join
00008 
00009     npyc = npyo = 0
00010     for root, dirs, files in os.walk(root):
00011         for name in files:
00012             delete = False
00013             if name.endswith('.pyc'):
00014                 delete = True
00015                 npyc += 1
00016             elif name.endswith('.pyo'):
00017                 delete = True
00018                 npyo += 1
00019 
00020             if delete:
00021                 os.remove(join(root, name))
00022 
00023     return npyc, npyo
00024 
npyc, npyo = deltree("../../Lib")

Here is the call graph for this function: