How to delete "\x" from element in list

hello, i have code

a = open("test.tab")
a = a.readlines()
print(a)
input()

the file test.tab is

0001 0002 
0001 0000 0000 0041 
0001 0000 0001 0042 
0001 0000 0002 0043 
0000 0001 0000 0001 
0000 0001 0001 0002 
0000 0001 0002 0003 

the result of program is
['\x00\x01\x00\x02\x00\x01\x00\x00\x00\x00\x00A\x00\x01\x00\x00\x00\x01\x00B\x00\x01\x00\x00\x00\x02\x00C\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x03']
how to delete “\x” from the result?

Looks like test.tab is actually a file containing binary data instead of ASCII text. How are you viewing it to get the first result you showed?

um, somehow? deleted \x

More information is needed to understand the situation properly.

Where does this file come from, and what do you expect that it should mean - what is the purpose of the contents?

When you say that the file “is” as you show, exactly how do you know this? What steps do you take in order to view the file contents?

You cannot “delete” that, because the result does not contain it. To explain this properly, I must first understand the above points, which will also give me a better understanding of what you already know or don’t know.

The \x is the way that python displays binary data.
So the first byte in the file is a 0x00 which python will represent in a string as "\x00".

As @kknechtel said where did you get this data file from and what do you expect it to contain? It is certainly not text, but some form of binary data.

Your ‘result’ is a list 1 string. Call that string s. It is not clear what you really want, but this might give you a hint.

>>> [hex(ord(c)).replace('0x', '') for c in s]
...  
['0', '1', '0', '2', '0', '1', '0', '0', '0', '0', '0', '41', '0', '1', '0', '0', '0', '1', '0', '42', '0', '1', '0', '0', '0', '2', '0', '43', '0', '0', '0', '1', '0', '0', '0', '1', '0', '0', '0', '1', '0', '1', '0', '2', '0', '0', '0', '1', '0', '2', '0', '3']