title: Python 2.5 convert string to binary
body: <p>I know this is easily possible in python 2.6.  But what is the easiest way to do this in Python 2.5?  </p>
  
  <pre><code>x = "This is my string"
  b = to_bytes(x)  # I could do this easily in 2.7 using bin/ord 3+ could use b"my string"
  print b
  </code></pre>
  
  <p>Any suggestions?   I want to take the x and turn it into </p>
  
  <blockquote>
    <p>00100010010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011101000111001001101001011011100110011100100010</p>
  </blockquote>