Unicode raw string containing \u
OKB (not okblacke)
brenNOSPAMbarn at NObrenSPAMbarn.net
Sun Oct 28 08:24:36 CET 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 u'\\' word 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)
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
More information about the Python-list