from concurrent import futures import os import re import sys import multiprocessing imagepaths = sys.stdin.readlines() imagepathscleaned = [s.replace('\n', '') for s in imagepaths] def sipper(n): #yTrunc = n.split('.') yTrunc = re.sub(r'....$', "", n) os.system("/usr/bin/sips -s format png \"" + n + "\" --out \"" + yTrunc + ".png\" > /dev/null" ) def main(): with futures.ProcessPoolExecutor() as executor: for number, prime in zip(imagepathscleaned, executor.map(sipper, imagepathscleaned)): print('huzzah!') if __name__ == '__main__': main()