FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/PC/VC6/rmpyc.py at 3.3 · python/cpython · GitHub
python
cpython
Repository navigation
Code
Issues
5k+
(5k+)
Pull requests
2.3k
(2.3k)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
PC
/
VC6
/
rmpyc.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (19 loc) · 600 Bytes
Breadcrumbs
cpython
/
PC
/
VC6
/
rmpyc.py
Copy path
File metadata and controls
25 lines (19 loc) · 600 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Remove all the .pyc and .pyo files under ../Lib.
def
deltree
(
root
):
import
os
from
os
.
path
import
join
npyc
=
npyo
=
0
for
root
,
dirs
,
files
in
os
.
walk
(
root
):
for
name
in
files
:
delete
=
False
if
name
.
endswith
(
'.pyc'
):
delete
=
True
npyc
+=
1
elif
name
.
endswith
(
'.pyo'
):
delete
=
True
npyo
+=
1
if
delete
:
os
.
remove
(
join
(
root
,
name
))
return
npyc
,
npyo
npyc
,
npyo
=
deltree
(
"../../Lib"
)
print
npyc
,
".pyc deleted,"
,
npyo
,
".pyo deleted"
Back
|
FazBrowse Home
|
New Git URL