Embedded 'C' problem?

Pete Shinners shredwheat at mediaone.net
Sat Jun 2 13:28:12 EDT 2001


"Samuel Schulenburg" <samschul at pacbell.net> wrote
>   File "<string>", line 1
> print """EB70:|30 E8 8A 17  00 00 66 89  04 9F 83 C4  08 43 3B 5C
> 0.....f......C;\"""
>
>                    ^
> SyntaxError: invalid token
>
> The problem is final "\" in the origional string is interfering with
> the final tripple quote forming a \""" which is interprited as an
> escape sequence.

for this problem, just use a double backslash at the end. you
could also place an r at the front of the string, which will
treat it as a raw string, giving backslash no special meaning.


r"""5c 0......f.....C:\"""







More information about the Python-list mailing list