Created
April 14, 2011 13:07
-
-
Save hhatto/919441 to your computer and use it in GitHub Desktop.
image file base64 encode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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