Created
January 3, 2015 17:11
-
-
Save freundTech/34ae58cd07304f7cf063 to your computer and use it in GitHub Desktop.
bin2ascii python script
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 | |
if len(sys.argv) == 1: | |
text = raw_input("Please enter binary data: ") | |
chars = text.split() | |
else: | |
chars = sys.argv[1:] | |
str_ = "" | |
for code in chars: | |
code = int(code, 2) | |
char = chr(code) | |
str_ += char | |
print(str_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment