Knitting is Binary!
In collaboration with Dale MacDonald, I wrote a code to take letters, transform them into binary code (the 1s and 0s that operate at the basest level of all computer systems), transform the 1s and 0s into purls and knits (the two basic stitches in knitting), and return a knitting pattern.
The resulting blanket consists of the repetition of four phrases inspired by loving-kindness meditation: May you be happy, May you be healthy, May you be loved, May you be in peace.

poemword = "MayYouBeInPeace"
knittingstring = ""
for ch in range(len(poemword)):
current_character = ord(poemword[ch])
for digit in range(6,-1,-1):
this_digit = ( current_character >> digit ) & 0x1
if this_digit:
knittingstring = (knittingstring + 'p')
else:
knittingstring = (knittingstring + 'k')
ind = 0
def gen_compressed_str(string):
global ind
comp_str = ""
len_str = len(string)
while (ind != len_str):
count = 1
while ((ind < (len_str-1)) and (string[ind] == string[ind+1])):
count = count + 1
ind = ind + 1
if (count == 1):
comp_str = comp_str + str(string[ind])
else:
comp_str = comp_str + str(string[ind]) + str(count)
ind = ind + 1
return comp_str
string = knittingstring
print (gen_compressed_str(string))