PY2EXE是否可以编译Python代码以更快地运行? [英] Does PY2EXE Compile a Python Code to run Faster?

查看:107
本文介绍了PY2EXE是否可以编译Python代码以更快地运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢PY2EXE模块,它确实可以帮助我与其他同事共享脚本,这些脚本非常易于使用.

I really like the PY2EXE module, it really helps me share scripts with other co-workers that are super easy for them to use.

我的问题是:当PY2EXE模块将代码编译成可执行文件时,生成的可执行文件处理速度更快吗?

My question is: when the PY2EXE module compiles the code into an executable, does the resulting executable process faster?

感谢您的答复!

推荐答案

py2exe只是将Python解释器和所有需要的库捆绑到可执行文件和一些库文件中.运行可执行文件时,它使用捆绑的解释器运行脚本.

py2exe just bundles the Python interpreter and all the needed libraries into the executable and a few library files. When you run the executable, it uses the bundled interpreter to run your script.

由于它实际上并未生成本机代码,因此执行速度应大致相同,由于打包所有内容的开销,执行速度可能会更慢.

Since it doesn't actually generate native code, the speed of execution should be about the same, possibly slower because of the overhead of everything being packaged up.

这篇关于PY2EXE是否可以编译Python代码以更快地运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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