using Examples.Plot2D;using System;using System.Linq;using System.Reflection;namespace Examples{/// <summary>/// Sample programm which creates several charts and save them in png/// </summary>class Program{/// <summary>/// Path to python.exe, must be initialized in Main/// </summary>private static string _pythonExePath;/// <summary>/// Path to dasPlot.py, script which finally builds plots/// </summary>private static string _matplotlibPyPath;static void Main(string[] args){if (args.Length != 3){Console.WriteLine("You must specify path to python.exe and to matplotlib_cs.py in command line arguments");Console.ReadKey();return;}_pythonExePath = args[1];_matplotlibPyPath = args[2];var assembly = Assembly.GetEntryAssembly();foreach (Type type in assembly.GetTypes().Where(x => x.GetInterfaces().Contains(typeof(IExample)))){if (args.Length > 0 && !args.Contains(type.Name))continue;Console.WriteLine($"{DateTime.UtcNow} Starting {type.Name}");var example = (IExample)Activator.CreateInstance(type);try{example.Run(_pythonExePath, _matplotlibPyPath);}catch (Exception ex){Console.WriteLine(ex);}Console.WriteLine($"{DateTime.UtcNow} Completed {type.Name}");}Console.ReadLine();}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。