I'm using ftplib
to create a simple script to push out a file to multiple IP addresses, all set up as FTP servers. I wanted to display progress in the file upload process, but I'm having an issue. I use the callback argument of FTP.storbinary()
and it works with something like this:
count = 0
def update(block):
count2 = str(count + 1)
print count2
However, if I try to do any arithmetic outside of a str()
call, the program hangs. So the following doesn't work:
count = 0
def update(block):
count += 1
print count
Even wrapping count
in a str()
call doesn't work. It just hangs on the first call.