I have a function that will (based on parameters) move/rename image files from a mapped card reader drive in Windows to a server drive after the file is renamed using a template and appending the incrementing number from the for loop.
There are usually three cards of photos that will be sent to the destination folder. Currently each card is being processed one after the other which because of the file sizes and traveling over the network can take quite some time.
is there a way to have a function that would receive a list of the mapped card drives (not more than 3) and then run the rename function simultaneously for each card.
My poor attempt to illustrate what I am trying to do follows:
def collectCards(cards):
for card in cards:
#my goal would be to run each instance of the following function asynchronously
drv =renameImages(card)
def renameImages(cardDrive):
#perform renaming functions
return count_of_renamed_images