C#中通过Process运行Python脚本

  • Post author:
  • Post category:python


<pre name="code" class="csharp">
<pre name="code" class="csharp"><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"></span><pre name="code" class="csharp">public void set_Python_Argv()
        {
            IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pLayer;
            IDataLayer dl = (IDataLayer)m_pLayer;
            IWorkspaceName ws = ((IDatasetName)(dl.DataSourceName)).WorkspaceName;
            string path = ws.PathName;

            //设置脚本参数
            string sArguments = @"shape_analyze.py";<span style="white-space:pre">	</span>//这里是python的文件名字
            string file_name = m_pLayer.Name;<span style="white-space:pre">		</span>//要被传入的文件名,不含后缀
   



版权声明:本文为protoss_penguin原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。