从vb.net执行python脚本 [英] execute python script from vb.net

查看:2701
本文介绍了从vb.net执行python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么可能从内部VB.NET code执行python脚本?

How I could execute a python script from within the VB.NET code?

我想用VB.NET建立一个图形用户界面我的Python脚本。 这是为了能够创建GUI一个脚本的用户

I would like to use VB.NET for building a GUI for my python script. This is to be able to create a GUI for the user of a script.

我发现这个例子:

Shell(c:\Program Files\python 266\python.exe path\myPythonScript.py +
       " " + arg1 + " " + argN)

不过,我想知道是否有执行python脚本的更合适的方式?

But I would like to know is there a more suitable way of executing python script?

我也想知道我怎么能在这样的设置处理错误。

I would also like to understand how I could handle errors in such setup.

您的帮助非常AP preciated!

Your help much appreciated!

谢谢

meryloo

推荐答案

您可以从.NET中调用Python,但如果你想这样做的唯一原因是因为你想设计一个GUI来回你的Python,为什么不继续东西'清洁',做这一切在Python?您可以使用 Tkinter的或的 wxPython的来名但有两个GUI的API。后者也有wxDesign其可以减轻GUI设计的负荷。

You could call python from within .NET but if the only reason you want to do that is because you want to design a GUI fro your Python, why not keep things 'cleaner' and do it all in Python? You can use TKInter or wxPython to name but two GUI APIs. The latter also has wxDesign which can lighten the load of GUI design.

此列表为您提供了GUI设计的一些更多的选择在Python比其他这两个我列出。

This list gives you some more options for GUI design in Python other than the two I've listed.

在另一方面,你不说你正在开发什么需要蟒蛇,但如果是无论是对ArcGIS的或GDAL(可能是两种最常见的GIS脚本环境)这两个具有.NET的API,以及蟒蛇。所以,你可能做到这一点的所有的.NET中。

On the other hand, you don't say what you are developing that needs python, but if it is either for ArcGIS or GDAL (probably the two most common GIS scripting environments) both of those have .NET APIs as well as Python. So, you could potentially do it ALL in .NET.

这篇关于从vb.net执行python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆