Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dfebb278
Commit
dfebb278
authored
Jan 23, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ah well, why not check this in. A script to remove all .pyc files in a folder hierarchy.
parent
3236f6ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
Mac/scripts/zappycfiles.py
Mac/scripts/zappycfiles.py
+35
-0
No files found.
Mac/scripts/zappycfiles.py
0 → 100644
View file @
dfebb278
# Zap .pyc files
import
os
import
sys
doit
=
1
def
main
():
if
os
.
name
==
'mac'
:
import
macfs
fss
,
ok
=
macfs
.
GetDirectory
(
'Directory to zap pyc files in'
)
if
not
ok
:
sys
.
exit
(
0
)
dir
=
fss
.
as_pathname
()
zappyc
(
dir
)
else
:
if
not
sys
.
argv
[
1
:]:
print
'Usage: zappyc dir ...'
sys
.
exit
(
1
)
for
dir
in
sys
.
argv
[
1
:]:
zappyc
(
dir
)
def
zappyc
(
dir
):
os
.
path
.
walk
(
dir
,
walker
,
None
)
def
walker
(
dummy
,
top
,
names
):
for
name
in
names
:
if
name
[
-
4
:]
==
'.pyc'
:
path
=
os
.
path
.
join
(
top
,
name
)
print
'Zapping'
,
path
if
doit
:
os
.
unlink
(
path
)
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment