擅长:python、mysql、java
<p>您还希望使用双反斜杠以在Python字符串中转义它们,因此</p>
<pre><code>file_list = os.listdir('C:\Users\B\Desktop\sil\sil2')
</code></pre>
<p>你想要的</p>
<pre><code>file_list = os.listdir('C:\\Users\\B\\Desktop\\sil\\sil2')
</code></pre>
<p>或者使用正斜杠-Python神奇地将它们视为Windows上的路径分隔符。</p>