Skip to content

Instantly share code, notes, and snippets.

@stpettersens
Created August 5, 2015 23:25
Show Gist options
  • Save stpettersens/15b6efd4f9586e3b273e to your computer and use it in GitHub Desktop.
Save stpettersens/15b6efd4f9586e3b273e to your computer and use it in GitHub Desktop.
base64 encoder
import sys
import base64
with open(sys.argv[1], 'rb') as binary_file:
encoded_string = base64.b64encode(binary_file.read())
print(encoded_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment