【发布时间】:2020-05-01 06:19:31
【问题描述】:
我在 aws 上部署了一个 ftp 服务器。我可以从 FileZilla 和命令行连接到它。但是,我给了我的python脚本:
OSError: [Errno 101] 网络不可达
我知道我的脚本可以工作,因为我可以连接到其他服务器。
def test_connection():
server = ftplib.FTP()
server.connect('xx.xxx.xxx.xx')
server.login('xxxx', 'xxx')
print(server.dir())
server.quit()
if __name__ == "__main__":
test_connection()
有什么线索吗?
非常感谢:)
【问题讨论】: