擅长:python、mysql、java
<p>您可以在每个<code>'\\u'</code>处删除带有<a href="https://docs.python.org/3/library/stdtypes.html#str.strip" rel="nofollow noreferrer">^{<cd1>}</a>和<a href="https://docs.python.org/3/library/stdtypes.html#str.split" rel="nofollow noreferrer">^{<cd2>}</a>的引号。这将把字符作为表示十六进制数的字符串。然后对于每个字符串,您可以将其转换为<code>int</code>,然后使用<a href="https://docs.python.org/3.6/library/functions.html#chr" rel="nofollow noreferrer">^{<cd5>}</a>返回到字符串:</p>
<pre><code>>>> street = "\"\\u4e2d\\u534e\\u8def\""
>>> ''.join(chr(int(x, 16)) for x in street.strip('"').split('\\u') if x)
'中华路'
</code></pre>