title: How to encode text to base64 in python
body: <p>I am trying to encode a text string to base64.</p>
  
  <p>i tried doing this :</p>
  
  <pre><code>name = "your name"
  print('encoding %s in base64 yields = %s\n'%(name,name.encode('base64','strict')))
  </code></pre>
  
  <p>But this gives me the following error:</p>
  
  <pre><code>LookupError: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs
  </code></pre>
  
  <p>How do I go about doing this ? ( using Python 3.4)</p>