怎么使c#windows窗体的setup.exe调用python脚本 [英] how make setup.exe of c# windows form which is calling python script

查看:206
本文介绍了怎么使c#windows窗体的setup.exe调用python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c#中创建了一个表单。这个表单中的一个按钮正在执行python脚本的exe。

i使用可视化项目安装程序生成此表单的setp.exe,但是在构建n安装setup.exe之后,当我打开exe时,错误是显示。

然而我做了另一个表格,它没有调用python脚本的exe并使这个表单的setup.exe工作正常。

plz。帮助,以便我可以制作c#form的setup.exe,调用python脚本的exe。



提前感谢

i have made a form in c#. one button in this form is executing exe of python script.
i made setp.exe of this form using visual project installer ,but after building n installing the setup.exe ,when i open the exe , error is displayed .
however i made another form which is not calling exe of python script and made setup.exe of this form then its working fine.
plz. help so that i can make setup.exe of c# form ,calling exe of python script.

thanks in advance

推荐答案

我看到你从可执行文件中调用Python的exe时遇到问题,因为你可能在代码中给出了python exe的绝对路径。

你可以验证它抛出的异常,通过某种错误记录(通过你喜欢的消息框的简单文本文件。)

只需将try catch块放在你调用python exe的代码中。
I see you are facing issue while calling exe of Python from your executable that is because you might have given absolute path of python exe within code.
You can verify what exception it is throwing, by some kind of error logging(by simple text file of message box which ever you prefer.)
Just put try catch block within code where you are calling python exe.


这篇关于怎么使c#windows窗体的setup.exe调用python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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