【发布时间】:2015-10-23 22:30:13
【问题描述】:
这是我的代码:
import ftputil
import urllib2
a_host = ftputil.FTPHost(hostname, username,passw)
for (dirname, subdirs, files) in a_host.walk("/"): # directory
for f in files:
if f.endswith('txt'):
htmlfile = open(f, 'r')
readfile = htmlfile.read()
我觉得应该没问题,但是我出错了
Traceback (most recent call last):
htmlfile = open(f, 'r')
IOError: [Errno 2] No such file or directory: u'readme.txt'
问题出在哪里?
【问题讨论】: