我搜索了如何使用 Python 通过 ftp 上传 csv 文件。我尝试了这段代码:
from ftplib import FTP
ftp = FTP("host")
ftp.login("user","password")
Output_Directory = "//ftp//data//"
File2Send="C://Test//test.csv"
file = open(File2Send, "rb")
ftp.cwd(Output_Directory)
ftp.storbinary('STOR ' + File2Send, file)
Run Code Online (Sandbox Code Playgroud)
这就是我得到的错误。我想我无法正确编写 ftp.storbinary 函数。谁能告诉我如何使其正确吗?
谢谢