How can I get the owner and group IDs of a directory using Python under Linux?
If you are using Linux, it is much easier.
Install tree with the command yum install tree. Then execute the command 'tree -a -u -g'
How to get the owner and group of a folder with Python on a Linux machine?