import sys
import struct

# write some latin letters in input.txt and use ASCII to understand the output
f = open('input.txt', 'rb')
b = f.read()
res = ''
for byte in b:
    print(bin(byte)[2:].zfill(8))
    res += bin(byte)[2:].zfill(8)
f.close()
print(res)

# why the variable has such a weird name?
GEC = '010001110100010101000011'

with open("bitstring.txt", "wb") as f:
    for i in range(0, len(GEC), 8):
        f.write(struct.pack('B', int(GEC[i:i+8], 2)))