Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Encodes a python file as white space
- import sys
- if len(sys.argv) < 2:
- print('Usage: %s <python-file>' % sys.argv[0])
- exit(1)
- filename = sys.argv[1]
- original_code = open(filename).read()
- code = "exec(''.join(chr(len(x)) for x in '"
- code += ' '.join('\t'*ord(x) for x in original_code)
- code += "'.split(' ')))"
- print(code)
Advertisement
Add Comment
Please, Sign In to add comment