I want to make an int from a string in python. I thought to translate the string first to binary like this:
st = 'string'
binSt = ' '.join(format(ord(x), '08b') for x in st)
returns this:
01110011 01110100 01110010 01101001 01101110 01100111
And then I want to translate the binary( in groups of 8) to integers which should to return this:
115 116 114 105 110 103
How can I do this? Is there maybe a special function in python or something?