2024-09-26 17:39:10 发布
网友
是否可以在visualstudio中使用python工具来实现对ASP.NETC应用程序和一些python代码?你知道吗
其次,如何从C#调用python脚本?你知道吗
提前谢谢。你知道吗
至于在C语言中运行python脚本,您可以这样做:
ProcessStartInfo start = new ProcessStartInfo(); start.FileName = "path/to/python.exe"; start.Arguments = string.Format("{0} {1}", cmd, args); start.UseShellExecute = false; start.RedirectStandardOutput = true; using(Process process = Process.Start(start)) { using(StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); Console.Write(result); } }
将python脚本作为cmd传递,将参数作为args传递。你知道吗
cmd
args
至于在C语言中运行python脚本,您可以这样做:
将python脚本作为
cmd
传递,将参数作为args
传递。你知道吗相关问题 更多 >
编程相关推荐