擅长:python、mysql、java
<p>当您只需输入对象的名称时,交互式Python将显示该对象的<em>表示形式</em>。另一方面,print命令尝试渲染字符。名为<strong>a</strong>的变量是字符串类型。实际上,python2.x中的字符串是一系列字节。所以,这取决于你的工作环境。对unicode()函数说现在使用gb2312编码。如果为真,则<strong>b</strong>包含给定编码中字符的正确表示。在</p>
<p>试着</p>
<pre><code>>>> print b
</code></pre>
<p>对你来说。你很可能会看到想要的结果。同时尝试:</p>
^{pr2}$
<p>表示是(如果可能的话)一个文本字符串,当复制粘贴到源代码时,将创建具有相同值的对象。在</p>
<p>看看马克·皮尔格林的《潜入Python 3》,第4章。字符串(<a href="http://getpython3.com/diveintopython3/strings.html" rel="nofollow">http://getpython3.com/diveintopython3/strings.html</a>)来获得一个好的、可读的解释。在</p>