V
Vincent Texier
Hello,
I want to send 3 chars in hexa code to the serial port.
So I type in a tkinter entry : "\x20\x01\x21"
The string is set in a StringVar().
When I read the stringVar, I get : "\\x20\\x01\\x21"
The length is 12 and not 3 anymore.
How can I replace the escape character from the string with the
corresponding char, and get my 3 char string back ?
I've tried a re.sub(r'\\', chr(92)) but chr(92) is a double backslash again.
Thanks for any help.
Vince.
I want to send 3 chars in hexa code to the serial port.
So I type in a tkinter entry : "\x20\x01\x21"
The string is set in a StringVar().
When I read the stringVar, I get : "\\x20\\x01\\x21"
The length is 12 and not 3 anymore.
How can I replace the escape character from the string with the
corresponding char, and get my 3 char string back ?
I've tried a re.sub(r'\\', chr(92)) but chr(92) is a double backslash again.
Thanks for any help.
Vince.