chainsol

Untitled

Aug 7th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. from itertools import chain
  2. from itertools import izip_longest
  3.  
  4. def chunks(n, iterable, padvalue=None):
  5. return izip_longest(*[iter(iterable)]*n, fillvalue=padvalue)
  6.  
  7.  
  8. def uuencode(text):
  9. b = "".join([bin(ord(c))[2:].rjust(8, '0') for c in text.encode('utf-8')])
  10. print(b)
  11. return(u"".join([chr(int("".join(c), 2)+32) for c in chunks(6, b, "000000")]))
Advertisement
Add Comment
Please, Sign In to add comment