Unicode raw string containing \u
OKB (not okblacke)
brenNOSPAMbarn at NObrenSPAMbarn.net
Sun Oct 28 03:24:36 EDT 2007
Steven D'Aprano wrote:
>> How can I specify a unicode raw string literal that
>> contains a
>> single backslash followed by the word "universe"?
>
> The usual way.
>
>>>> word = u'\\universe' len(word) 9 word[0] u'\\' word[1] u'u'
>>>> print word \universe word u'\\universe'
That doesn't answer my question, since I asked for a unicode RAW
string literal. Is this not possible? (I was able to get what I want
using ur"\u005Cuniverse", although this is not totally ideal.)
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
More information about the Python-list
mailing list