I want to change the file permission for all the files from my current directory tree. I am trying to open each directory and open the files and change the permission using
for dirpath, dirnames, filenames in os.walk('.'):
for filename in filenames:
path = os.path.join(dirpath, filename)
os.chmod(path, 0o777) # for example