title: Reading a binary file on backwards using python
body: <p>I try to read a file backwards (from end to begin). The example below does this, but I would like to ask the community - is there a more elegant solution to my question?</p>
  
  <pre><code>import os, binascii
  
  CHUNK = 10 #read file by blocks (big size)
  src_file_path = 'd:\\src\\python\\test\\main.zip' 
  src_file_size = os.path.getsize(src_file_path)
  src_file = open(src_file_path, 'rb') #open in binary mode
  while src_file_size &gt; 0:
      #read file from last byte to first :)
      if src_file_size &gt; CHUNK:
          src_file.seek(src_file_size - CHUNK)
          byte_list = src_file.read(CHUNK)
      else:
          src_file.seek(0)
          byte_list = src_file.read(src_file_size)
      s = binascii.hexlify(byte_list) #convert '\xFB' -&gt; 'FB'
      byte_list = [(chr(s[i]) + chr(s[i+1])) for i in range(0, len(s), 2)] #split, note below
      print(byte_list[::-1]) #output reverse list
      src_file_size = src_file_size - CHUNK
  src_file.close() #close file
  </code></pre>
  
  <p><strong>UPD</strong> I would like to know the opinion of experts - what do I need to pay attention as newbie in Python? Is there a potential flaw in this code?</p>
  
  <p>Thanks in advance.</p>
  
  <p>I'm using Python 3.3.1
  Note: split by bytes from <a href="https://stackoverflow.com/questions/16381660/how-to-split-binary-string-with-python">here</a>!</p>