Beispiel #1
0
    try:
        first = int(sys.argv[2], 10)
        count = int(sys.argv[3], 10)
        skip = int(sys.argv[4], 10)
    except:
        first = 0
        count = 10000000
        skip = 1


    if not os.path.isdir(path+'/t42/'):
        os.makedirs(path+'/t42/')


    if 1:
        p = Pool(multiprocessing.cpu_count())
        it = p.imap(process_file, list_files(path+'/vbi/', path+'/t42/', first, count, skip), chunksize=1)
        for i in it:
            pass

    else: # single thread mode for debugging
        def doit():
            map(process_file, list_files(path+'/vbi/', path+'/t42/', first, count, skip))
        cProfile.run('doit()', 'myprofile')
        p = pstats.Stats('myprofile')
        p.sort_stats('cumulative').print_stats(50)