Flask app with ArcGIS, Arcpy does not run

二次信任 提交于 2019-12-05 02:06:15
dai

Instead of calling the function, I ran my script with DOS.

@app.route('/cad2json', methods=['POST'])
def cad2sde():
    dwg_path = request.form.get('dwg_path')
    reference_scale = request.form.get('reference_scale')
    spatial_reference = request.form.get('spatial_reference')
    target_layer = request.form.get('target_layer')
    sentence =   (u'C:\\Python27\\ArcGIS10.1\\python.exe C:\\Users\\Administrator           \\Desktop\\flask\\cad.py %s %s %s %s'
             %(dwg_path,reference_scale,spatial_reference,target_layer))
    p = os.popen(sentence)
    return format(p.read())
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!