문제

I have some code like this:

def getnews():
try:
    server = 'ftp://25.102.81.171'
    ftp= ftplib.FTP(server)
    username = ' '
    password = ' '
    ftp.login(username,password)
    filename = 'news_2014.txt'
    path = 'news'
    ftp.cwd(path)
    textlines = []
    ftp.retrlines('RETR' + filename, textlines.append)
    newswindw = Toplevel(background="grey")
    news1 = Label(newswindw, text="textlines", background="white")
    news1.pack()
except IOError:
    tkMessageBox.showerror("failed", "failed for some reason.")

every time I run it, I get the exception, and if I run it without the try, it gives me a gaeierror: getadderinfo failed any way to fix this?

올바른 솔루션이 없습니다

다른 팁

the server line doesn't need "ftp://"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top