-
Notifications
You must be signed in to change notification settings - Fork 1
/
clean.py
25 lines (19 loc) · 1.43 KB
/
clean.py
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
#!/usr/bin/python
# NOTE:
# This is the code. If you are seeing this when you open the program normally, please follow the steps here:
# https://sites.google.com/site/evanspythonhub/having-problems
#-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# INFO AREA:
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Program by: Evan
# SCRIPT made in 2012
# This program removes .pyc files from at or below its current directory.
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# DATA AREA: (IMPORTANT: DO NOT MODIFY THIS SECTION!)
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
from __future__ import with_statement, print_function, absolute_import, unicode_literals, division
import os
for dirpath, dirnames, filenames in os.walk(os.path.basename(os.getcwd())):
for filename in filenames:
if filename.endswith(".pyc"):
os.remove(os.path.abspath(os.path.join(dirpath, filename)))