我有以下代码:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
for filename in os.listdir(u'/path/to/my/folder'):
with open(filename) as f:
# do something about it
我收到这样的错误:
Traceback (most recent call last):
File "/home/user/test/src/main.py", line 6, in <module>
with open(filename) as f:
IOError: [Errno 2] No such file or directory: u'helloworld\u751f.html'
有什么想法吗?
如果重要的话,我正在使用python 2.7.5。
提前致谢!