If you want the callback()
function to change the global variable intProgress
, you have to declare it as global
in the function...
def callback(p):
global intProgress
intProgress = intProgress + 1024
##sys.stdout.write(str(intProgress))
sys.stdout.write("-")
...otherwise it'll assume intProgress
is a local variable, and get confused by the fact that you're trying to reference it when setting it.