I have a script where I upload a file that takes some time, because there is enough data to read and so that the user can not complete the process, I want to show some indication of loading. I thought it was a good opportunity to learn how to use the multiprocessing module, so I wrote this example to test the module:
import time, multiprocessing def progress(): delay = 0.5 while True: print "Loading.", time.sleep(delay) print "\b.", time.sleep(delay) print "\b.", time.sleep(delay) print "\r \r", return def loader(filename, con):
It works as I expect, when I run it in windows cmd, it prints “Download” and sequentially adds points until the bootloader completes. But on unix, where I need it, I don't get any result from the progress function, process p1.
source share