我正在使用 iSeries Access ODBC 驱动程序来尝试对 DB2 for i 运行查询。我想让这些信息更易读。如何使用 python 转换字节数组信息?下面的示例输出:
>>> cursor.execute("SELECT * FROM QAAPFILE$")
<pyodbc.Cursor object at 0x00C6D2C0>
>>> for row in cursor:
... print row
Example Output:
(1, bytearray(b'\xfd@@@@@@@@@'), 1, 1, 8, 9, bytearray(b'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'), bytearray(b'@@@@@@@@@@@@@@@@@@@@'), bytearray(b'\x00<\x02\x82B\x02\x02<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))
Many more rows