无堆栈 Python 和 PyQt
您对 Stackless Python 和 PyQt 有什么经验?
如果人们解决以下问题,我会很高兴:
用于 Stackless 的 PyQt 编译:PyQt 是否需要专门针对 Stackless 进行编译?编译顺利吗?绑定等问题。
稳定性:是否有任何意外的崩溃、冻结、暂停和其他奇怪现象?
内存管理:任何内存泄漏的提示。 Stackless/Plain Vanilla PyQt 应用程序所需 RAM 的比较
软件工程授权:Stackless 驱动的 PyQt 应用程序的控制流模型的非常简短的概述
经验教训:学到的任何痛苦的教训,要避免的陷阱,要解决的问题你可能遇到过
“快乐”
What experiences do you have with Stackless Python and PyQt?
Issues i would be happy if people address:
Compilation of PyQt for Stackless: does PyQt need to be compiled especially for Stackless? is the compilation smooth? problems with bindings etc.
Stability: any unexpected crashes, freezes, pauses and other weirdities?
Memory Management: any hints of memory leaks. comparison of RAM needed for a Stackless/Plain Vanilla PyQt applications
Software Engineering Empowerment: very short outline of flow-of-control models for Stackless-powered PyQt applications
Lessons learned: any painful lesson learned, traps to be avoided, problems to tackle you might have experienced
Be Happy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几个月前,我尝试走这条路,但觉得不值得。
我能够针对无堆栈版本的 Python 运行 PyQt(在 Windows 上)的二进制安装,但我发现我必须手动进入并更改一些文件。我收到一条错误消息(抱歉,我忘了它是什么),谷歌搜索找到了几年前的解决方案。较新的代码不包含旧的修复程序,因此更改并不太困难,并且(如果我没记错的话)它是用 python 编写的,因此无需重新编译。
但这对我来说是一个破坏性的事情。 Qt 更新定期发布,PyQt 更新也是如此,我不想不断修复代码。 Stackless 和 PyQt 根本没有充分结合使用,无法进行彻底检查。我发现难以调试问题的风险相当高。鉴于 stackless 的作者已经转向 PyPy,这一点尤其正确。让我提前道歉 - 我希望我能找到作者停止在 stackless python 上进行开发的参考资料,以及有关我必须修复的错误的更多详细信息 - 我没想到会在 Stack Overflow 上重复这些详细信息。
因此,我选择在普通 Python 上运行 PyQt,而不是在 stackless 上运行。
顺便说一句,我还认为将信号/槽与无堆栈代码混合会令人困惑,因为它们是解决多线程问题的完全不同的方法。
祝你好运!
I tried to go down this path several months ago and decided it was not worth the effort.
I was able to run a binary install of PyQt (on Windows) against a stackless version of Python, but I found that I had to manually go in and change some of the files. I was getting an error message (sorry, I forget what it was), and google search led to a solution from several years ago. Newer code did not include the old fix, so the change was not too difficult and (if I remember correctly) it was in python, so no recompile was necessary.
But that was a deal breaker for me. Qt updates come out regularly, as do updates to PyQt, and I didn't want to be continually fixing the code. Stackless and PyQt are simply not used enough together to be checked out thoroughly. I found the risk of difficult to debug issues pretty high. This is especially true given the author of stackless has moved on to PyPy. Let me apologize in advance - I wish I had the references I found for the author stopping development on stackless python and more detail on the errors I had to fix - I wasn't expecting to regurgitate the details on Stack Overflow.
So I chose to run PyQt on a vanilla Python instead of stackless.
BTW, I also thought that mixing signals/slots with stackless code would be confusing, as they are completely different methods of solving multi-threading problems.
Good luck!
如果您因为速度优化而对所有这些感兴趣:
您可能需要查看Unladen Swallow(此处为维基百科 > ). Google(因为 YouTube 是 100% Python)正在开发 Python 的 JIT 编译器,它将使其速度提高 5-10 倍(使其比当前虚拟机更接近 Java 速度)。最好的部分是它可以与所有现有的 Python 代码一起使用,这意味着您不必担心与其他 Python 优化项目相关的所有问题。
我预计,如果您正在开发一个足够大的项目来保证低级别优化的需要,那么您可以使用普通的 Python 进行开发,然后在 Unladen Swallow 投入生产时更换当前的 VM。
If you're interested in all that because of speed optimization:
You may want to check out Unladen Swallow ( Wikipedia here ). Google (because of YouTube being 100% Python) is working on a JIT compiler for Python that will increase its speed by 5-10x (bringing it much closer to Java speeds than the current virtual machine). The best part is that it will work with all existing Python code which means you don't have to fret with all the problems associated with other Python optimization projects.
I expect that if you're developing a large enough project to warrant the need for optimization at a low level, you'd be OK with developing in normal Python and then changing out of the current VM when Unladen Swallow comes out in production.