我试图通过python将文件发送到cpanlweb服务器,第一次我创建了一个ftp用户,然后我使用这个代码进行上传,但是出现了以下错误
python代码:
import ftplib as FTP
ftp = FTP("ftp.example.com")
ftp.login (username='xxxxxxxxxxxxxxx', password="xxxxxxxx")
ftp.cwd('/home/example/public_html/img')
def image_ftp_send():
filename = '1.jpg'
ftp.storbinary('STOR '+filename , open(file, 'rb'))
ftp.quit()
错误:
Traceback (most recent call last):
File "Image ftp", line 24, in <module>
ftp = FTP("ftp.example.com")
TypeError: 'module' object is not callabl
下面的代码没有您得到的错误。你知道吗
相关问题 更多 >
编程相关推荐