A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/299769.html below:

FTP status problems. (Again)

FTP status problems. (Again) FTP status problems. (Again)Nainto Nainto at gmail.com
Sat Sep 17 17:52:14 EDT 2005
Unfortunatly I stiill get the same error. :-(
Here is the code:
import ftplib
class ProgressFile(file):
	def read(self, size = None):
		from sys import stdout
		if size is not None:
			buff = file.read(self, size)
			if buff:
				stdout.write('.')
			else:
				stdout.write('\n')
			return buff
		else:
			buff = ''
			while True:
				new_str = file.read(self, 1024)
				stdout.write('.')
				if new_str:
					buff = buff + new_str
				else:
					stdout.write('\n')
					break
				return buff
if __name__ == '__main__':
	ftp = ftplib.FTP("ftp.sadpanda.cjb.cc")
	ftp.login("sadpanda","PASSWORDEDITIEDOUT")
	filename = "/FrenchBrochure.pages.zip"
	ftp.storbinary("STOR " + filename, ProgressFile(filename, "rb"), 1024)

	ftp.quit()


Thanks again.


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4