Skip to content

Instantly share code, notes, and snippets.

@alice1017
Created December 6, 2010 03:38
Show Gist options
  • Save alice1017/729804 to your computer and use it in GitHub Desktop.
Save alice1017/729804 to your computer and use it in GitHub Desktop.
.pycファイルを削除する
#!/usr/bin/python
#coding:utf-8
"""This Module is delete .pyc-files.
Usage::
python index.py
"""
import os
flist = os.listdir(os.getcwd())
for i in range(len(flist)):
root = flist[i].split(".")
ext = root[1]
if ( ext == "pyc" ):
cmd = "rm "+str(flist[i])
os.system(cmd)
print "the end."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment