How to change the user and group permissions for a directory, by name?
Question: [os.chown](http://docs.python.org/library/os.html#os.chown) is exactly what I
want, but I want to specify the user and group by name, not ID (I don't know
what they are). How can I do that?


Answer: 
    import pwd
    import grp
    import os
    
    uid = pwd.getpwnam("nobody").pw_uid
    gid = grp.getgrnam("nogroup").gr_gid
    path = '/tmp/f.txt'
    os.chown(path, uid, gid)
    

