I would like to list all unique extension types in a recursive directory. I have tried the following code, it didn't print anything. It works if I put for example ".m4a". In addition, even if this code worked for ".*" it was going to list all the files but I only want the list of unique extensions. Cant list of extensions and search for them because I dont know what different file types exist.
for file in os.listdir(root):
if file.endswith(".*"):
print(os.path.join(root, file))
This question has been asked at How can I find all of the distinct file extensions in a folder hierarchy? but it didn`t help because it is for Linux machine.
thanks in advance.