# Note that we feed a file name, not a file handle # and permissions are in octal format -- 0oXXX os.chmod(file_name, 0o640)