(no subject)

myang myang at clarku.edu
Mon Mar 15 11:19:51 EST 2004


Maybe a stupid question, but I really know nothing about binary data.

Got a binary data file, opened it with binary mode, and read the first line,
print it out, and I got:
'T\x00\x00\x00CORD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
00\x00\x00\x00\x00\x1a\x00\x00\x00T\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\
x00\x04\x00\x00\x00\x04\x00\x00\x00\xdd\x06\x00\x00\x04\x00\x00\x00t\x1b\x00
\x00/\xdd|A\x83\xc0lA\xb2\x9d\x81A\x08\xac\x80A\x00\x00\x83A\x9c\xc4\x84AV\x
0e\x8eA\xfc\xa9\x92A\xa0\x1a\x8dA\xa6\x9b\x95A\x98n\x9cA)\\uA\xd7\xa3nA\x1b/
oAq=rAh\x91\x81A\xc3\xf5jA\xdd$hAj\xbcrA\x1f\x85cA\x06\x81SA{\x14NAffHA\x04V
\\A\xf6(PAy\xe9bA^\xbaUA%\x06wAb\x10\x80A\x17\xd9\x80A\x81\x95wA\xd3M\x81A\x
1dZrA\x9a\x99\x85A\x93\x18\x87A\x0e-\x8fA\xf4\xfd\x81A\xaa\xf1~A\xd5xuA\xd9\
xce\x85A\x02+\x88Ad;\x80A\xf8S\x8aA\xecQ\x8eA^\xba\x8bA!\xb0\x92A\xdfO\x8dA\
x19\x04\x87A=\n'

How can I covert these codes into human-readable string? I am sure the
filecontains only some float numbers and some characters.

Thanks!

Best,
Yang





More information about the Python-list mailing list