title: How to convert from Base64 to string Python 3.2
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13261802/converting-a-string-to-and-from-base-64">Converting a string to and from Base 64</a>  </p>
  </blockquote>
  
  
  
  <pre><code>def convertFromBase64 (stringToBeDecoded):
      import base64
      decodedstring=str.decode('base64',"stringToBeDecoded")
      print(decodedstring)
      return
  
  convertFromBase64(dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE=)
  </code></pre>
  
  <p>I am tying to take a base64 encoded string and convert it back to the original string but I cant figure out quite what is wrong</p>
  
  <p>I am getting this error</p>
  
  <pre><code> Traceback (most recent call last):
   File "C:/Python32/junk", line 6, in &lt;module&gt;
  convertFromBase64(("dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE="))
   File "C:/Python32/junk", line 3, in convertFromBase64
  decodedstring=str.decode('base64',"stringToBeDecoded")
  AttributeError: type object 'str' has no attribute 'decode'
  </code></pre>