os.chmod(path, mode, *, dir_fd=None, follow_symlinks=True)
Change the mode of path to the numeric mode. mode may take one of the following values (as defined in the stat module) or bitwise ORed combinations of them:
stat.S_ISUIDstat.S_ISGIDstat.S_ENFMTstat.S_ISVTXstat.S_IREADstat.S_IWRITEstat.S_IEXECstat.S_IRWXUstat.S_IRUSRstat.S_IWUSRstat.S_IXUSRstat.S_IRWXGstat.S_IRGRPstat.S_IWGRPstat.S_IXGRPstat.S_IRWXOstat.S_IROTHstat.S_IWOTHstat.S_IXOTH
This function can support specifying a file descriptor, paths relative to directory descriptors and not following symlinks.
Note
Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value). All other bits are ignored.
New in version 3.3: Added support for specifying path as an open file descriptor, and the dir_fd and follow_symlinks arguments.
Please login to continue.