title: How to convert binary string to ascii string in python?
body: <p>I've made a little python program that reads binary from a file and stores it to a text file, read the text file and store the binary. But, I can't get the binary to work...
  it reads the files like this:</p>
  
  <pre><code>f_bin = open(bin_file,"rb")
  to_bin_data = f_bin.read()
  bin_data = bin(reduce(lambda x, y: 256*x+y, (ord(c) for c in to_bin_data), 0))
  f_bin.close()
  </code></pre>
  
  <p><strong>this one doesen't work for me... <a href="https://stackoverflow.com/questions/7396849/convert-binary-to-ascii-and-vice-versa-python">Convert binary to ASCII and vice versa</a></strong></p>
  
  <p>Something like this webpage: <a href="http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.asp" rel="nofollow noreferrer">http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.asp</a></p>
  
  <p><strong>Edit: I've now made a long if else script for it, but thanks for the answers</strong> </p>