The following import works inside ipy.exe prompt but fails using IronPython ScriptRuntime inside a C# 4.0 program.
import ConfigParser
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
namespace CSharpDynamic
{
class Program
{
static int Main(string[] args)
{
ScriptRuntime python = Python.CreateRuntime();
dynamic dynamicIni =
python.UseFile(@"c:estWebCastDynamicIni.py");
return 0;
}
}
}
CPython uses PYTHONPATH environment variable. How do I configure this in IronPython when using ScriptRuntime?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…