<p>我在文件管理方面有问题。
我必须搜索一个扩展名为.txt的文件,但是路径每天都在变化。你知道吗</p>
<p>我有一个包含实际路径的另一个文件,我可以将它存储在字符串中,但是当我
给搜索算法一个窗口掉一个错误消息。你知道吗</p>
<p>这是我的剧本:</p>
<pre><code>path= 'c:\..... this is the path what I get back from an another script'
os.chdir(path)
for files in os.listdir("."):``
if files.endswith(".txt"):
print files
</code></pre>
<p>错误消息:WindowsError:[错误3]系统找不到指定的路径:“c:…”</p>