本文实例讲述了python实现简单ftp客户端的方法。分享给大家供大家参考。具体实现方法如下:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import ftplib
import os
import socket
HOST = 'ftp.mozilla.org'
DIRN = 'pub/mozilla.org/webtools'
FILE = 'bugzilla-3.6.9-to-3.6.10-nodocs.diff.gz'
def writedata(data):
f = open(FILE,'wb')
try:
f.write(d
1