将C#GUI与Python代码相结合?

编程入门 行业动态 更新时间:2024-10-12 03:24:27
本文介绍了将C#GUI与Python代码相结合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以构建一个C#表单(使用Visual Studio),但是只写Python事件的?有没有办法告诉你的程序 每当代码运行时运行Python,因为它将是所有Python代码 (例如按钮按等)? br /> 我知道它有点傻,它会让你的程序依赖于.NET,但是 这将是一个很好的简单方法来创建一个GUI,同时仍然写在 Python中,如果可能的话。

Is it possible to construct a C# form (using Visual Studio) but write only Python code for the events? Is there some way to tell your program to run Python whenever code is run, since it will be all Python code (e.g. for button presses, etc.)? I know it''s sort of silly, and it makes your program depend on .NET, but it would be a nice and easy way to create a GUI while still writing in Python, if it''s possible.

推荐答案

首先,你应该考虑一下ironpython而不是 cpython。 这样你就可以忘记c#并在(铁)python中完成所有这些。 我我不知道它目前的状态,但微软正在开发一个Visual Studio - Ironpython集成。 欲了解更多信息: http://lists.ironpython / htdig.cg ... ry / 001752.html First of all, you should be thinking about ironpython instead of cpython. This way you can forget about c# and do it all in (iron)python. I don''t know its current state, but Microsoft is working in a Visual Studio - Ironpython integration. For more info: lists.ironpython/htdig.cg...ry/001752.html

现在在我想到它,我不确定Visual Studio是否可以用ironpython创建 GUI。我想在这一刻,它的整合仅仅是一个文本编辑器(虽然我可能错了)。 我几乎忘了它,但有人正在使用一个小工具, 将C#表单转换为python类(用于与ironpython一起使用)。 检查出来: www.digitalfanatics/e8johan/projects/cs2py/ Now that I think about it, I''m not sure if Visual Studio can create GUIs with ironpython already. I guess that at this moment, its integration is as a text editor only (I may be wrong though). I almost forgot it, but someone was working in a little tool that converts C# forms into python classes (for being used with ironpython). Check it out: www.digitalfanatics/e8johan/projects/cs2py/

LuisM.González写道: Luis M. González wrote: 现在我想起来了,我不确定Visual Studio是否可以创建已经有了ironpython的GUI。我想在这一刻,它的整合只是一个文本编辑器(虽然我可能错了)。 我差点忘了它,但有人正在使用一个小工具<将C#表单转换为python类(用于与ironpython一起使用)。 检查出来: www.digitalfanatics/e8johan/projects/cs2py/ Now that I think about it, I''m not sure if Visual Studio can create GUIs with ironpython already. I guess that at this moment, its integration is as a text editor only (I may be wrong though). I almost forgot it, but someone was working in a little tool that converts C# forms into python classes (for being used with ironpython). Check it out: www.digitalfanatics/e8johan/projects/cs2py/

谢谢你信息!

Thanks for the information!

更多推荐

将C#GUI与Python代码相结合?

本文发布于:2023-11-12 11:07:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581320.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:代码   GUI   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!