-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakeFilesNonExecutable.py
More file actions
18 lines (16 loc) · 991 Bytes
/
MakeFilesNonExecutable.py
File metadata and controls
18 lines (16 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
import sys
import numpy as np # Useful for numerical calculations on an array
import os # Used for changing directories and open files with folders
from subprocess import call # Allows Python to call shell script
import shutil # allows python to execute terminal commands (such as rm mv cp ...)
import re # module used in sed (function) to find and replace text
import glob # module used to find files in a directory (used to remove temporary files)
from operator import itemgetter # Allows us to find groups of consecutive numbers
from tqdm import tqdm # module to produce and view a progress bar; valuable when running many simulations
import tempfile as tp
for root, dirs, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".py"):
# print(os.path.join(root, file))
p = call(['chmod', '-x', os.path.join(root, file)])