1

I have a folder of files with no extension that range from mp4 to png i need to sort them base on mime type to give them the right extension but i can't find any way of geting mime type of more than 1 file. I need to get of all the files in that folder.

I tried using built in lib mimetypes with an array but i got TypeError: expected str, bytes or os.PathLike object, not list.

Edit: Comment by Jay solved my issue.

Mr. Pekr
  • 11
  • 2
  • 1
    Does this answer your question? [How to find the mime type of a file in python?](https://stackoverflow.com/questions/43580/how-to-find-the-mime-type-of-a-file-in-python) – Jay Nov 25 '22 at 11:16
  • You will have to loop over all the files in the dir one by one. – Jay Nov 25 '22 at 11:20

0 Answers0