擅长:python、mysql、java
<p>在Python中,3个字符串默认为Unicode。在python2中,它们是在源文件编码中编码的字节字符串。在python2中使用Unicode字符串。你知道吗</p>
<p>还要确保声明源文件编码,并确保源文件保存在该编码中。你知道吗</p>
<pre><code>#coding:utf8
from pathlib import *
rootdir=Path(ur'D:\新建文件夹')
print(rootdir.exists())
</code></pre>