global sou_file global des_file sou_file = open(sou_path+filename, 'rb') des_file = open(des_path+filename, 'wb+') # pool = Pool(10) # pool.map(tran_sub, sou_file) threads = [gevent.spawn(tran_sub, line) for line in sou_file.readlines()] gevent.joinall(threads) sou_file.close() des_file.close()
if __name__ == '__main__': main()
# for line in lines: # if line.startswith('Dialogue:'): # parts = line.rsplit(',,', 1) # line = ',,'.join([parts[0], parts[1].lstrip().capitalize()]) # f.write(line)