]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/mac/zappycfiles.py
1 #!/usr/local/bin/python
2 """Recursively zap all .pyc and .pyo files"""
6 # set doit true to actually delete files
7 # set doit false to just print what would be deleted
14 fss
, ok
= macfs
.GetDirectory('Directory to zap pyc files in')
17 dir = fss
.as_pathname()
20 print 'Usage: zappyc dir ...'
22 for dir in sys
.argv
[1:]:
26 os
.path
.walk(dir, walker
, None)
28 def walker(dummy
, top
, names
):
30 if name
[-4:] in ('.pyc', '.pyo'):
31 path
= os
.path
.join(top
, name
)
36 if __name__
== '__main__':