Python Forum
read a binary file to find its type
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
read a binary file to find its type
#4
thanks a lot for the replies. I am looking for jpeg files and the values are:
FF, D8, FF in hex and 255, 216, 255 in integers. taken from https://en.wikipedia.org/wiki/List_of_file_signatures
now i have
b'\xff\xd8\xff'
how do i show that one in each line and next to hex have the conversion to integer, please?
Reply


Messages In This Thread
read a binary file to find its type - by atux_null - Nov-22-2017, 12:35 PM
RE: read a binary file to find its type - by atux_null - Nov-22-2017, 08:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using dictionary to find the most sent emails from a file siliusu 6 7,831 Apr-22-2021, 06:07 PM
Last Post: siliusu
  Can we store value in file if we open file in read mode? prasanthbab1234 3 2,707 Sep-26-2020, 12:10 PM
Last Post: ibreeden
  [split] how to read a specific row in CSV file ? laxmipython 2 9,079 May-22-2020, 12:19 PM
Last Post: Larz60+
  Read data from a CSV file in S3 bucket and store it in a dictionary in python Rupini 3 7,228 May-15-2020, 04:57 PM
Last Post: snippsat
  read from file mcgrim 16 6,482 May-14-2019, 10:31 AM
Last Post: mcgrim
  Read directly from excel file using python script dvldgs05 0 2,327 Oct-19-2018, 02:51 AM
Last Post: dvldgs05
  Read a data from text file (Notepad) Leonzxd 24 14,491 May-23-2018, 12:17 AM
Last Post: wavic
  Homework - Read from/Write to file (renamed from Help help help) Amitkafle 1 3,140 Jan-11-2018, 07:24 AM
Last Post: wavic
  Cannot read from text file aljonesy 5 3,744 Oct-05-2017, 05:56 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020