initial commit of project

This commit is contained in:
2021-04-11 19:51:12 +02:00
commit a21a8186d9
110 changed files with 16326178 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import os
import sys
import re
def remove_pyc(folderpath):
"""Remove all pyc files from a folder."""
pyc_paths = []
# Save paths to all .pyc files in folder to list
for folder, subs, files in os.walk(folderpath):
for filename in files:
full_path = os.path.join(folder, filename)
is_pyc = re.search(r'\.pyc', full_path)
if is_pyc:
pyc_paths.append(full_path)
# Remove all files in list
for path in pyc_paths:
file = os.remove(path)