I don’t know python and I’m porting a library to C#, I’ve encountered the following lines of code that is used in some I/O operation but I’m not sure what it is, my guess is that it’s a hexadecimal but I don’t know why it’s inside a string, neither what the backslashes do?
sep1 = '\x04H\xfe\x13' # record separator
sep2 = '\x00\xdd\x01\x0fT\x02\x00\x00\x01' # record separator
The backslashes are escape characters. They allow you to insert special characters (IE a quotation mark) inside a string. \xNN is hexadecimal, like you say.
It looks like they’re using a string in place of an array to me. I’m not really sure why someone would do this… but oh well
I’m not familiar with C#, but in C, sep1 is similar to
char[] {0x04H, 0xfe, 0x13}(with an additional 0 at the end if it’s a null terminated string)