操作系统是win7,Python版本是2.7,研究字符编码。
>>> a = "高山流水"
>>> a
'\xb8\xdf\xc9\xbd\xc1\xf7\xcb\xae'
>>> print type(a)
<type 'str'>
>>> b = r"高山流水"
>>> b
'\xb8\xdf\xc9\xbd\xc1\xf7\xcb\xae'
>>> len(b)
8
>>> type(b)
<type 'str'>
上面建立了两个变量a、b,
操作系统是win7,Python版本是2.7,研究字符编码。
>>> a = "高山流水"
>>> a
'\xb8\xdf\xc9\xbd\xc1\xf7\xcb\xae'
>>> print type(a)
<type 'str'>
>>> b = r"高山流水"
>>> b
'\xb8\xdf\xc9\xbd\xc1\xf7\xcb\xae'
>>> len(b)
8
>>> type(b)
<type 'str'>
上面建立了两个变量a、b,