Python how to change global variables
I would like to get some kind of confirmation that the download is successful, I have my methods similar to the following. However, the value of the global variable does not change. Please, help
global upload_confirm
upload_confirm = False
def confirm_upload():
upload_confirm = True
def start_new_upload():
confirm_upload()
while (upload_confirm != True):
print "waiting for upload to be true"
time.sleep(5)
if (upload_confirm == True):
print "start Upload"
start_new_upload()
+3
source to share