一起使用 Python 3.1 和 2.5

发布于 2024-11-08 15:21:26 字数 177 浏览 1 评论 0原文

我目前正在为我的编程课做最后一个项目。我们正在用 Python 3.1 编写它,而我正在做 GUI。我的团队领导希望在 3.1 中完成整个项目,但大多数 pyGame 插件(如 pyConsole)给我带来了兼容性问题。

所以,我的问题是,我可以在 2.5 中编写前端,然后将其连接到 3.1 中编写的引擎吗?感谢您的帮助!

I'm currently working the final project for my programming class. We're writing it in Python 3.1, and I'm doing the GUI. My team's leader wants to do the whole project in 3.1, but most pyGame addons (like pyConsole) are giving me compatibility issues.

So, my question is, can I write my frontend in 2.5 and then hook it up to the engine that's written in 3.1? Thanks for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心舞飞扬 2024-11-15 15:21:26

老实说,这可能带来的麻烦大于其价值。

最好的办法是聚集在一起,列出你们想要使用的插件以及它们是否与 3.1 兼容。然后决定你是否可以在没有不兼容的人的情况下生活。如果你不能,就用 2.5 来做这个项目,否则就用 3.1 并为你不能使用的插件制定一个“B 计划”。

如果您小心的话,当这些插件添加对 3.x 的支持时,您可以在以后相对轻松地从 2 切换到 3。

如果这是一个您计划长期从事的项目(即不仅仅是一个班级项目),我可能会说选择 3 并尝试自己移植一些插件。但对于一个班级的期末项目来说,这可能不值得。

To be honest, that's probably more trouble than it's worth.

Your best bet is to get together and make a list of the addons you guys want to use and whether or not they're compatible with 3.1. Then decide if you can live without the incompatible ones. If you can't, do the project in 2.5, otherwise go with 3.1 and have a "Plan B" for the addons you can't use.

If you're careful you can make switching from 2 to 3 relatively painless later on when those addons add support for 3.x.

If it's a project you plan on working on for a long time (i.e. more than just a class project), I'd probably say go with 3 and try porting some of the addons yourself. But for a class' final project it's probably not worth it.

紫瑟鸿黎 2024-11-15 15:21:26

简短回答 否。

更长的答案。您可以使用 Python 2.5 编写前端,使用 3.0 编写后端,但它们根本无法交互。它们之间需要某种抽象层。做这样的事情你可以在另一边使用任何语言。

抽象层需要将作业拉出并推回某种队列。这只是一个愚蠢的例子,当你继续阅读时可能会变得非常复杂。最后,抽象层可能会变得比您的应用程序更复杂,假设它是一个类的工作。

我会听 Jeremiah 并与教授讨论 Python 2.5 或 3.0 的优点和缺点。如果你在最后的论文中解释一下你选择其中一个的原因,我相信你会得到一些额外的分数,而且他几乎不会因此而惩罚你。

Short Answer NO.

Longer Answer. You can write your frontend with Python 2.5 and the backend with 3.0, but they can't interact at all. You need some sort of abstraction layer between them. Doing something like this you can have any language in the other side.

The abstraction Layer would need to pull jobs work on them and push back to some sort of queue. This is just a silly example and can get really complicated as you go by. In the end the abstraction layer may become even more complicated than you application, assuming it's a work for a class.

I'd listen to Jeremiah and discuss with professor about the goods and bads that you have going with Python 2.5 or 3.0. If you include an explanation of the reasons you choose one over the other in your final papper I'm sure you'll get some extra points and he'll hardly penalyze you for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文