@Gintaras thanks
I have a problem. Where is the script file for currently edited?
In the following code, I need to put two Python files in the same directory
Found a small problem, com lists, if do not select item, can not close it
I found the file path:
C:\Users\Administrator\Documents\Aedit\Main\files
I have a problem. Where is the script file for currently edited?
In the following code, I need to put two Python files in the same directory
C# code:
// script "ipy_code2.cs" /*/ r Libraries\IronPython.dll; r Libraries\Microsoft.Scripting.dll; r Libraries\Microsoft.Dynamic.dll; /*/ //.
using Au; using System; using Microsoft.Scripting.Hosting;
using System.Collections.Generic;
partial class Script : AScript { [STAThread] static void Main(string[] a) => new Script(a); Script(string[] args) { //;;;
AOutput.RedirectConsoleOutput=true;
ScriptEngine pythonEngine = IronPython.Hosting.Python.CreateEngine();
// Print the default search paths
System.Console.Out.WriteLine("Search paths:");
ICollection<string> searchPaths = pythonEngine.GetSearchPaths();
foreach (string path in searchPaths)
{
System.Console.Out.WriteLine(path);
}
System.Console.Out.WriteLine();
// Now modify the search paths to include the directory from
// which we execute the script
searchPaths.Add("..\\..");
pythonEngine.SetSearchPaths(searchPaths);
// Execute the script
// We execute this script from Visual Studio so the program will executed from bin\Debug or bin\Release
Microsoft.Scripting.Hosting.ScriptSource pythonScript = pythonEngine.CreateScriptSourceFromFile("..\\..\\HelloWorld.py");
pythonScript.Execute();
}
}
Found a small problem, com lists, if do not select item, can not close it
I found the file path:
C:\Users\Administrator\Documents\Aedit\Main\files