We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
这个 Python minifier 看起来它可以满足您的需要。
This Python minifier looks like it does what you need.
我推荐 minipy。最引人注目的原因是它对源代码抽象语法树进行了正确的分析,因此缩小的代码更加准确。我发现更知名的 pyminifier 往往会生成带有未定义符号错误的代码,被误解元组等。我还使用 minipy 获得了好几个百分点的压缩结果。 minipy 的一个小好处是它的代码大小不到 pyminifier 的一半。它也更容易管理和集成到构建管道中,因为它是一个独立的 python 文件。
I recommend minipy. The most compelling reason is that it does proper analysis of the source code abstract syntax tree so the minified code is much more accurate. I've found that the more well known pyminifier tends to generate code with undefined symbol errors, misinterpreted tuples, etc. I also got a few percent better compression results with minipy. A minor benefit of minipy is that it's less than half the code size of pyminifier. It's also easier to manage and integrate into a build pipeline because it's a single standalone python file.