开发者

generating compiled Tkinter python code

I've noticed that when creating a GUI using Tkinter in python, when running the final .py/.pyw file, I'm not presented with a .pyc file. I'd like to give my application to someone for personal usage, without giving him the full source code. Is there anyway of forcing the interpreter to generate a pyc file, or any other way t开发者_Python百科o get nothing but python bytecode without using py2exe or cxfreeze or similar things?


Try:

import py_compile
py_compile.compile(r'/path/to/your/file.py')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜