Examples:
A console application
print 'Hello World!'To compile console applications, create a setup.py file and then write the following code:
from distutils.core import setup import py2exe setup(console=['hello.py'])Then, terminal access is required for compiling process. Write it as the following code:
python setup.py py2exeNext, py2exe will try to generate the executable file for running that Python program on Windows. A GUI application
from Tkinter import * app = Tk() app.mainloop()GUI applications need to modify console application setup code a bit as the following commands:
from distutils.core import setup import py2exe setup(windows=['ui.py'])Then, use the same command that I already mentioned above. In addition, py2exe tutorial can be looked for more information at: http://www.py2exe.org/index.cgi/Tutorial
No comments:
Post a Comment