arcpy多进程出图

利用多进程读取几百个mxd导出jpg,一直运行,但是没有导出图片。是哪里搞错了吗,请高手指点
import arcpy,os,sys,re,time,multiprocessing 
reload(sys)
sys.setdefaultencoding('utf8')      
##  
def ExpJPG(mxdpath,outpath):
            ftype='.jpg'
            #for mxdpath in range(x):
            mxd=arcpy.mapping.MapDocument(mxdpath)
            savejpgpath=os.path.join(outpath,mxdpath.split(".")[0].split("\\")[-1]+ftype)
            arcpy.mapping.ExportToJPEG(mxd,savejpgpath)    #resolution=rec
            del mxd
####
def main():
    from arcpy import env
    filepath=ur"D:\poi\MXD"         #(1)mxd存档目录
    outpath=ur"D:\poi\jpg"           #(2)jpg存档目录
    mxds= infiles(filepath)  #获取所有mxd路径数组
    multiprocessing.set_executable('C:/Python27/ArcGIS10.5/pythonw.exe')
    pool = multiprocessing.Pool(4)
    #xx=[[1,10],[10,20],[20,30],[30,40]]
    for mxdpath in mxds:
          pool.apply_async(ExpJPG,(mxdpath,outpath,))
          time.sleep(1)
    pool.deamon=True
    pool.close()
    pool.join()
####### 
if __name__=="__main__":
    main()
 
已邀请:

要回复问题请先登录注册