title: How to concatenate many binary file in one file in python?
body: <p>I need to append many binary files  in one binary file. All my binary files are saved i one folder:</p>
  
  <pre><code>   file1.bin
     file2.bin
     ...
  </code></pre>
  
  <p>For that I try by using this code:</p>
  
  <pre><code>import numpy as np
  import glob
  import os
  Power_Result_File_Path ="/home/Deep_Learning_Based_Attack/Test.bin"
  Folder_path =r'/home/Deep_Learning_Based_Attack/Test_Folder/'  
  os.chdir(Folder_path)
  npfiles= glob.glob("*.bin")
  loadedFiles = [np.load(bf) for bf in binfiles]
  PowerArray=np.concatenate(loadedFiles, axis=0)
  np.save(Power_Result_File_Path, PowerArray)
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <pre><code>    "Failed to interpret file %s as a pickle" % repr(file))
  OSError: Failed to interpret file 'file.bin' as a pickle
  </code></pre>
  
  <p>My problem is how to  concatenate binary file it is not about anaylysing every file indenpendently.</p>