Last active
January 7, 2016 17:35
-
-
Save wallacemaxters/9c36cd28874e4e75855e to your computer and use it in GitHub Desktop.
Pequeno script em python para converter arquivo para base64
This file contains hidden or 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
| #-*- coding: utf-8 -*- | |
| from base64 import b64encode | |
| print "Digite o nome/caminho do arquivo que deseja abrir: \n" | |
| read_filename = raw_input(); | |
| with open(read_filename, 'rb') as file: | |
| base64_contents = b64encode(file.read()) | |
| print "Agora, digite o nome/caminho do arquivo em que deseja salvar o base64: \n" | |
| write_filename = raw_input() | |
| with open(write_filename, 'wb') as file: | |
| file.write(base64_contents) | |
| print "finalizado com sucesso...\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment