Skip to content

Instantly share code, notes, and snippets.

@hhatto
Created April 14, 2011 13:07
Show Gist options
  • Save hhatto/919441 to your computer and use it in GitHub Desktop.
Save hhatto/919441 to your computer and use it in GitHub Desktop.
image file base64 encode
import sys
from base64 import encodestring
with open(sys.argv[1]) as f: # argv[1] is 'xx.png'
print encodestring(f.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment