Recently I have been interested in FTP servers and I was wondering how to get a python script to download and upload files onto a FTP server I have set up. But I can't seem to get it to work. Every time I typ in this like of code:

ftp = FTP_TLS("ftp.10.0.1.14")

It gives me an error, sorry if it's a stupid question but all my research on the subject say that we're you put the server's adress.

Thanks!

有帮助吗?

解决方案

Remove that "ftp." from the beginning of the address you have - it is not part of the IP address. Also, make sure you are importing FTP_TLS:

from ftplib import FTP_TLS
ftp = FTP_TLS("10.0.1.14")

As a side note, when you are getting an error it is a good idea to include the exact error you are getting in your question.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top