import win32security
import ntsecuritycon as con
FILENAME = 'H:\\path_to_file\\file.txt'
user, domain, type = win32security.LookupAccountName('', 'Your Username')
sd = win32security.GetFileSecurity(FILENAME, win32security.
    DACL_SECURITY_INFORMATION)
dacl = sd.GetSecurityDescriptorDacl()
dacl.AddAccessAllowedAce(win32security.ACL_REVISION, con.FILE_ALL_ACCESS, user)
sd.SetSecurityDescriptorDacl(1, dacl, 0)
win32security.SetFileSecurity(FILENAME, win32security.
    DACL_SECURITY_INFORMATION, sd)
Setting group permissions with python