How to check type of files without extensions? [duplicate]

There are Python libraries that can recognize files based on their content (usually a header / magic number) and that don’t rely on the file name or extension. If you’re addressing many different file types, you can use python-magic. That’s just a Python binding for the well-established magic library. This has a good reputation and … Read more