小编spa*_*tan的帖子

使用Python通过ftp上传csv文件

我搜索了如何使用 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 函数。谁能告诉我如何使其正确吗?

谢谢

python ftp

1
推荐指数
1
解决办法
7356
查看次数

标签 统计

ftp ×1

python ×1