Skip to content

Instantly share code, notes, and snippets.

@epifanio
Created April 1, 2015 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epifanio/c69650fbf8b986b7a443 to your computer and use it in GitHub Desktop.
Save epifanio/c69650fbf8b986b7a443 to your computer and use it in GitHub Desktop.
from IPython.core.display import HTML
video = open("/home/epifanio/jupyter/mp_video_unh/time.mkv", "rb").read()
video_encoded = video_encoded = video.encode("base64").decode('ascii')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-22-70cb70c5b2b2> in <module>()
1 from IPython.core.display import HTML
2 video = open("/home/epifanio/jupyter/mp_video_unh/time.mkv", "rb").read()
----> 3 video_encoded = video_encoded = video.encode("base64").decode('ascii')
AttributeError: 'bytes' object has no attribute 'encode'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment