You need to understand that "\ x21" and "!" are two ways of representing the same thing
therefore "\x21\x23\x22\x21\x22\x31"coincides with'!#"!"1'
>>> "\x21\x23\x22\x21\x22\x31" == '!#"!"1'
True
>>> infile = open('infile.txt', 'rb')
>>> list(infile.read())
['!', '#', '"', '!', '"', '1']
>>> ['!', '#', '"', '!', '"', '1'] == ["\x21","\x23","\x22","\x21","\x22","\x31"]
True
, , , python