Skip to content

Instantly share code, notes, and snippets.

@freundTech
Created January 3, 2015 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freundTech/34ae58cd07304f7cf063 to your computer and use it in GitHub Desktop.
Save freundTech/34ae58cd07304f7cf063 to your computer and use it in GitHub Desktop.
bin2ascii python script
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