2024-09-30 05:23:26 发布
网友
我想在单击按钮时在cmd中运行Python脚本VB.Net. 您需要在批处理文件中调用Python脚本吗?或者你可以直接用VB来做吗?在
我试过了
Dim ps As New ProcessStartInfo("cmd.exe") ps.Arguments = "C:\yourbatfile.bat" Process.Start(ps)
但这只会打开cmd窗口,而不执行bat文件。在
Dim psi = New ProcessStartInfo("c:\python27\python.exe", "myPythonScript.py") Dim proc = Process.Start(psi) proc.WaitForExit() If proc.ExitCode <> 0 then throw new Exception(" Script Failed")
相关问题 更多 >
编程相关推荐