[Tutor] File extension against File content
ingo
ingo at ingoogni.nl
Fri May 31 06:38:09 EDT 2019
Many file formats have "magic bytes" that you can use for that purpose.
https://en.wikipedia.org/wiki/List_of_file_signatures
Ingo
On 31-5-2019 12:03, Sunil Tech wrote:
> Hi Tutor,
>
> Is there any way that I can actually programmatically compare the file
> extension with its content?
>
> This is because we can manually save the file in one extension and later
> rename the file extension to some other.
>
> Thanks
> - Sunil. G
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list