title: Convert HEX string into base64 in Python
body: <p>is it even possible to have an input converted ?</p>
  <blockquote>
  <p>from base64 import b64encode, b64decode</p>
  </blockquote>
  <blockquote>
  <p>d = input('What&quot;s your HEX string?  ')</p>
  <p>b64 = b64encode(bytes.fromhex(d)).decode()</p>
  <p>print(&quot;Your HEX in base64 is:&quot;,  b64)</p>
  </blockquote>
  <pre><code>**b64 = b64encode(bytes.fromhex(d)).decode()
  </code></pre>
  <p>ValueError: non-hexadecimal number found in fromhex() arg at position 1**</p>