I saw in this post that its easy to print on the same line (overwriting the previous content) the following way:
print "Downloading " + str(a) " file of " + str(total),
(note the comma at the end). This would result in
>>> Downloading 1 file of 20
and each time the print is executed, the same line is updated.
This works well in a single threaded application, but it does not work with multiple threads.
How can multiple threads print to its own line in the terminal in python 2.7?
The desired result would look something like this:
>>> Thread 1: Downloading 11 file of 20
>>> Thread 2: Downloading 4 file of 87
>>> Thread 3: Downloading 27 file of 32
>>> Thread 4: Downloading 9 file of 21