[{"user_id": 10074, "stars": [], "topic_id": 33596, "date_created": 1304498236.8649659, "message": "hey guys, i have a string with \"000000010000001F\" and i want to convert it into raw bits. If you would print the raw bits, you will get a lot of \"?\" (question marks) because it often has not the right code for letters.", "group_id": 292, "id": 910641}, {"user_id": 10074, "stars": [], "topic_id": 33596, "date_created": 1304498258.0913501, "message": "How can i achieve this?", "group_id": 292, "id": 910651}, {"user_id": 31883, "stars": [], "topic_id": 33596, "date_created": 1304506185.053365, "message": "@Samuirai I think you want \"\".join(str(bin(ord(x)))[2:].zfill(8) for x in that_string), but if that string is formatted as bytes in hex (e.g. \"1F\" == 31), then you want str(bin(int(that_string, 16)))[2:]", "group_id": 292, "id": 911630}, {"user_id": 222, "stars": [{"date_created": 1304541507.6970789, "user_id": 20326}, {"date_created": 1304561404.0114341, "user_id": 12831}, {"date_created": 1304582347.8982041, "user_id": 141}], "topic_id": 33596, "date_created": 1304538040.519418, "message": "The right way:\n\n >>> import binascii\n >>> binascii.a2b_hex('000000010000001F')\n '\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x1f'\n\nCheating:\n\n >>> '000000010000001F'.decode('hex')\n '\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x1f'", "group_id": 292, "id": 918652}, {"user_id": 222, "stars": [], "topic_id": 33596, "date_created": 1304538071.95239, "message": "If you want to get a list of int instead of a str you can map(ord, _) on that or use the array module.", "group_id": 292, "id": 918664}]