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')
精彩评论